Last updated: 2018-02-04

Loading required package: ashr
corrplot 0.84 loaded
Package 'mclust' version 5.4
Type 'citation("mclust")' for citing this R package in publications.

Attaching package: 'mclust'
The following object is masked from 'package:ashr':

    dens

Case 1: Not force mean to 0

Using clustering result to fit mash:

\[l_{i}\sim \sum_{i=1}^{m}N(\mu_{i}, \Sigma_{i})\] We estimate the covariance as \(F(\Sigma_i + \mu_{i}\mu_{i}')F'\). The mash model including these covariances has the weights:

There are 4512 siginificant findings. The log likelihood is 3.080580110^{4}. The loglikelihood improves. The weights are on Load 3, Load 9, Load 10, Load 11, Load 12. Let’s visualize these matrices:

The covariave structures are captured correctly.

Case 2: Force mean to 0

In this case, we force the clusters have mean 0. The mash model including these covariances has the weights:

There are 4512 siginificant findings. The log likelihood is 3.080419110^{4}. The loglikelihood improves. The weights are on Load 2, Load 3, Load 19, Load 21, Load 23. Let’s visualize these matrices:

Conclusion

If the data depends on more than one factors, we’d better add the correponding covairance structure to the model.

I tried to forcing mean of loading in the clustering be 0, but I think this is not reasonable. We expect the loading matrix has column mean 0, but here, we are separating the rows of lading matrix into several groups. Each group could have non-zero column mean, but the overall column mean is zero.

Session information

sessionInfo()
R version 3.4.3 (2017-11-30)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS High Sierra 10.13.3

Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] plyr_1.8.4    mclust_5.4    corrplot_0.84 mashr_0.2-4   ashr_2.2-3   
[6] flashr_0.4-3 

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.15             knitr_1.17              
 [3] magrittr_1.5             REBayes_1.2             
 [5] MASS_7.3-47              doParallel_1.0.11       
 [7] pscl_1.5.2               SQUAREM_2017.10-1       
 [9] lattice_0.20-35          ExtremeDeconvolution_1.3
[11] foreach_1.4.4            stringr_1.2.0           
[13] tools_3.4.3              parallel_3.4.3          
[15] grid_3.4.3               rmeta_2.16              
[17] htmltools_0.3.6          iterators_1.0.9         
[19] assertthat_0.2.0         yaml_2.1.16             
[21] rprojroot_1.2            digest_0.6.13           
[23] Matrix_1.2-12            codetools_0.2-15        
[25] evaluate_0.10.1          rmarkdown_1.8           
[27] stringi_1.1.6            compiler_3.4.3          
[29] Rmosek_8.0.69            backports_1.1.2         
[31] mvtnorm_1.0-7            truncnorm_1.0-7         

This R Markdown site was created with workflowr