Fit the high-dimensional multi-study robust factor model which learns latent features and accounts for the heterogeneity among source.

MultiRFM(
  XList,
  q = 15,
  qs = rep(2, length(XList)),
  epsELBO = 1e-05,
  maxIter = 30,
  verbose = TRUE,
  seed = 1
)

Arguments

XList

A length-M list, where each component represents a matrix and is the

q

an optional integer, specify the number of study-shared factors; default as 15.

qs

a integer vector with length M, specify the number of study-specifed factors; default as 2.

epsELBO

an optional positive vlaue, tolerance of relative variation rate of the envidence lower bound value, defualt as '1e-5'.

maxIter

the maximum iteration of the VEM algorithm. The default is 30.

verbose

a logical value, whether output the information in iteration.

seed

an optional integer, specify the random seed for reproducibility in initialization;default as 1.

Value

return a list including the following components:(1) F, a list composed by the posterior estimation of study-shared factor matrix for each study; (2) H, a list composed by the posterior estimation of study-specified factor matrix for each study; (3) Sf, a list consisting of the posterior estimation of covariance matrix of study-shared factors for each study; (4) Sh, a list consisting of the posterior estimation of covariance matrix of study-specified factors for each study; (5) A, the loading matrix corresponding to study-shared factors; (6) B, a list composed by the loading matrices corresponding to the study-specified factors; (7) mu,the mean of XList;(8) ELBO: the ELBO value when algorithm stops; (9) ELBO_seq: the sequence of ELBO values. (10) time_use, the elapsed time for model fitting.

Details

None

Examples

p <- 100
nvec <- c(150,200); qs <- c(2,2)
datList <- gendata_simu_multi(seed=1, nvec=nvec, p=p, q=3, qs=qs, rho=c(5,5),
        err.type='mvt', sigma2_eps = 1, nu=3)
XList <- datList$Xlist;
res <- MultiRFM(XList, q=3, qs= qs)
#> iter = 2, ELBO= -55422.950814, dELBO=0.999974 
#> iter = 3, ELBO= -49115.240144, dELBO=0.113810 
#> iter = 4, ELBO= -43502.329541, dELBO=0.114280 
#> iter = 5, ELBO= -42313.812732, dELBO=0.027321 
#> iter = 6, ELBO= -42104.427302, dELBO=0.004948 
#> iter = 7, ELBO= -41998.999079, dELBO=0.002504 
#> iter = 8, ELBO= -41921.373899, dELBO=0.001848 
#> iter = 9, ELBO= -41859.930112, dELBO=0.001466 
#> iter = 10, ELBO= -41809.782423, dELBO=0.001198 
#> iter = 11, ELBO= -41768.039192, dELBO=0.000998 
#> iter = 12, ELBO= -41732.778972, dELBO=0.000844 
#> iter = 13, ELBO= -41702.645666, dELBO=0.000722 
#> iter = 14, ELBO= -41676.644051, dELBO=0.000624 
#> iter = 15, ELBO= -41654.022774, dELBO=0.000543 
#> iter = 16, ELBO= -41634.202027, dELBO=0.000476 
#> iter = 17, ELBO= -41616.726374, dELBO=0.000420 
#> iter = 18, ELBO= -41601.232739, dELBO=0.000372 
#> iter = 19, ELBO= -41587.427985, dELBO=0.000332 
#> iter = 20, ELBO= -41575.072818, dELBO=0.000297 
#> iter = 21, ELBO= -41563.969994, dELBO=0.000267 
#> iter = 22, ELBO= -41553.955510, dELBO=0.000241 
#> iter = 23, ELBO= -41544.891934, dELBO=0.000218 
#> iter = 24, ELBO= -41536.663284, dELBO=0.000198 
#> iter = 25, ELBO= -41529.171047, dELBO=0.000180 
#> iter = 26, ELBO= -41522.331048, dELBO=0.000165 
#> iter = 27, ELBO= -41516.070974, dELBO=0.000151 
#> iter = 28, ELBO= -41510.328385, dELBO=0.000138 
#> iter = 29, ELBO= -41505.049112, dELBO=0.000127 
#> iter = 30, ELBO= -41500.185959, dELBO=0.000117 
str(res)
#> List of 13
#>  $ F       :List of 2
#>   ..$ : num [1:150, 1:3] 1.0945 0.479 -0.5584 -0.4673 0.0694 ...
#>   ..$ : num [1:200, 1:3] -1.218 -0.722 -2.382 -0.191 -0.103 ...
#>   ..- attr(*, "dim")= int [1:2] 2 1
#>  $ H       :List of 2
#>   ..$ : num [1:150, 1:2] -0.832 0.752 2.335 -0.654 2.224 ...
#>   ..$ : num [1:200, 1:2] -1.634 0.2 2.49 0.352 -1.085 ...
#>   ..- attr(*, "dim")= int [1:2] 2 1
#>  $ Sf      :List of 2
#>   ..$ : num [1:3, 1:3, 1:150] 2.56e-03 2.53e-05 -7.15e-05 2.53e-05 3.71e-03 ...
#>   ..$ : num [1:3, 1:3, 1:200] 9.35e-04 2.31e-05 -4.00e-06 2.31e-05 1.35e-03 ...
#>   ..- attr(*, "dim")= int [1:2] 2 1
#>  $ Sh      :List of 2
#>   ..$ : num [1:2, 1:2, 1:150] 0.034785 0.000302 0.000302 0.064868 0.016089 ...
#>   ..$ : num [1:2, 1:2, 1:200] 0.012408 0.000242 0.000242 0.026018 0.034496 ...
#>   ..- attr(*, "dim")= int [1:2] 2 1
#>  $ mu      : num [1:100, 1:2] -0.629 -0.064 -0.75 -0.712 0.163 ...
#>  $ A       : num [1:100, 1:3] 1.388 1.614 -2.543 -0.314 -1.782 ...
#>  $ B       :List of 2
#>   ..$ : num [1:100, 1:2] 0.50372 -0.00428 -0.64485 -0.48204 0.89396 ...
#>   ..$ : num [1:100, 1:2] 0.7541 -0.0209 -1.0104 0.6775 -0.0492 ...
#>   ..- attr(*, "dim")= int [1:2] 2 1
#>  $ nu      : num 3
#>  $ Lambda  : num [1:100, 1:2] 0.717 0.827 0.958 0.921 0.737 ...
#>  $ ELBO    : num -41500
#>  $ dELBO   : num 4.86
#>  $ ELBO_seq: num [1:30] -2.15e+09 -5.54e+04 -4.91e+04 -4.35e+04 -4.23e+04 ...
#>  $ time_use: Named num 0.66
#>   ..- attr(*, "names")= chr "elapsed"