RMFM | R Documentation |
Fit the high-dimensional robust matrix factor model via variational inference.
RMFM(
X,
r1 = 10,
r2 = 10,
epsELBO = 1e-09,
maxIter = 30,
verbose = TRUE,
seed = 1,
cal_eigs = FALSE
)
X |
a p1* p2*T array, which is the observed matrix from each individual, where T is the sample size. |
r1 |
an optional positive integer, specify the number of row factors; default as 10. |
r2 |
an optional positive integer, specify the number of column factors; default as 10. |
epsELBO |
an optional positive value, tolerance of relative variation rate of the variational lower bound value, default as '1e-9'. |
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. |
cal_eigs |
an optional logical value, specify whether calculate the eigenvalues of covariance matrix, default as |
None
return a list including the following components:
hF
- a r1* r2*T array, which is the estimated factor matrix for each individual, where T is the sample size.
hmu
- a p1-by-p2 matrix, the estimated mean matrix.
hR
- the estimated row loading matrix.
hC
- the estimated column loading matrix.
hnu
- the estimated degree of freedom for the error term.
hLambda1
- a p1 vector, the estimated row scatter matrix for error.
hLambda2
- a p2 vector, the estimated column scatter matrix for error.
dR
- NULL
if cal_eigs=FALSE
; a group of eigenvalues of the sample covariance across rows if cal_eigs=TRUE
.
dC
- NULL
if cal_eigs=FALSE
; a group of eigenvalues of the sample covariance across columns if cal_eigs=TRUE
.
ELBO
- the ELBO value when algorithm stops;
ELBO_seq
- the sequence of ELBO values.
time_use
- the running time in model fitting of RMFM;
None
None
r1 <- 4; r2 <- 3;
Tt <- 100; type <- 'MatrixT'
p1 <- 50; p2 <- 50
datlist <- gendata_rmfm(Tt = Tt,p1 =p1, p2=p2, r1=r1, r2=r2,
rho=1, type= 'MatrixT', nu=1)
str(datlist)
reslist <- RMFM(X=datlist$X, r1=r1, r2=r2, verbose = TRUE, maxIter = 6)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.