Multivariate Bayesian variable selection regression

Try out paralleled numpy computations

In [1]:
dat = readRDS('/home/gaow/Documents/GTExV8/Thyroid.Lung.FMO2.filled.rds')
attach(dat)
In [2]:
%get X Y --from R
Y = Y.as_matrix()
Loading required package: feather
In [3]:
from libgaow.regression_data import MASH
import numpy as np
In [4]:
model = MASH(X=X,Y=Y)
model.set_prior({'identity': np.identity(2), 
                 'single_1': np.array([[1,0],[0,0]]), 
                 'single_2': np.array([[0,0], [0,1]]), 
                 'all_in': np.ones((2,2))}, 
                [0.5,1], 
                [0.9,0.01,0.01,0.01,0.01,0.01,0.01,0.02,0.02])
In [5]:
from time import time
t0 = time()
model.fit()
t1 = time()
In [6]:
t1 - t0
Out[6]:
19.080756664276123
In [7]:
model.post_mean_mat
Out[7]:
array([[ -1.49884347e-04,  -6.36060586e-04,  -9.44192821e-04, ...,
          1.24769557e-04,   1.71446659e-05,   1.49532499e-04],
       [ -1.28376438e-04,  -5.37549875e-04,  -1.19440242e-03, ...,
          2.34743878e-05,   1.51444262e-04,   3.88329156e-05]])
In [ ]:


Copyright © 2016-2020 Gao Wang et al at Stephens Lab, University of Chicago