Last updated: 2018-02-27

Code version: 5769f40

R.matlab v3.6.1 (2016-10-19) successfully loaded. See ?R.matlab for help.

Attaching package: 'R.matlab'
The following objects are masked from 'package:base':

    getOption, isOpen

Presidential Address data:

The data contains word counts from the inaugural addresses of 13 US presidents (1940–2009). There are 13 rows (presidents) and 836 columns (words), and each entry indicates the number of times a particular word was used in a particular address. Since both row and column means vary greatly here we pre-processed the data by centering and scaling both rows and columns, using the biScale function from softImpute.

data = readMat('../data/PresiAdd.mat')
data = data$Yscaled

Flash:

flash.data = flash_set_data(data)
fmodel = flash(flash.data, greedy = TRUE, backfit = TRUE)

saveRDS(fmodel, '../output/PresiAddVarCol.rds')

Flash again on the loading matrix

flash.loading = flash_set_data(fmodel$EL[,1:5])
flmodel = flash(flash.loading, greedy = TRUE, backfit = TRUE)
fitting factor/loading 1
fitting factor/loading 2

The result means that the loading matrix is nearly zero except the last column. This implies that the original data set could be factored with only the last factor.

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] R.matlab_3.6.1 flashr_0.5-1  

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.15      knitr_1.17        magrittr_1.5     
 [4] MASS_7.3-47       pscl_1.5.2        doParallel_1.0.11
 [7] SQUAREM_2017.10-1 lattice_0.20-35   foreach_1.4.4    
[10] ashr_2.2-4        stringr_1.2.0     tools_3.4.3      
[13] parallel_3.4.3    grid_3.4.3        ebnm_0.1-10      
[16] R.oo_1.21.0       git2r_0.20.0      iterators_1.0.9  
[19] htmltools_0.3.6   yaml_2.1.16       rprojroot_1.2    
[22] digest_0.6.13     assertthat_0.2.0  softImpute_1.4   
[25] Matrix_1.2-12     codetools_0.2-15  R.utils_2.6.0    
[28] evaluate_0.10.1   rmarkdown_1.8     stringi_1.1.6    
[31] compiler_3.4.3    backports_1.1.2   R.methodsS3_1.7.1
[34] truncnorm_1.0-7  

This R Markdown site was created with workflowr