CMGFM {CMGFM}R Documentation

Fit the CMGFM model

Description

Fit the covariate-augumented generalized factor model

Usage

CMGFM(
  XList,
  Z,
  types,
  numvarmat,
  q = 15,
  Alist = NULL,
  init = c("LFM", "GFM", "random"),
  maxIter = 30,
  epsELBO = 1e-08,
  verbose = TRUE,
  add_IC_iter = FALSE,
  seed = 1
)

Arguments

XList

a list consisting of multiple matrices in which each matrix has the same type of values, i.e., continuous, or count, or binomial/binary values.

Z

a matrix, the fixed-dimensional covariate matrix with control variables.

types

a string vector, specify the variable type in each matrix in XList;

numvarmat

a length(types)-by-d matrix, specify the number of variables in modalities that belong to the same type.

q

an optional string, specify the number of factors; default as 15.

Alist

an optional vector, the offset for each unit; default as full-zero vector.

init

an optional character, specify the method in initialization.

maxIter

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

epsELBO

an optional positive value, tolerance of relative variation rate of the evidence lower bound value, default as '1e-8'.

verbose

a logical value, whether output the information in iteration.

add_IC_iter

a logical value, add the identifiability condition in iterative algorithm or add it after algorithm converges; default as FALSE.

seed

an integer, set the random seed in initialization, default as 1;

Details

None

Value

return a list including the following components:

References

None

See Also

None

Examples

pveclist <- list('gaussian'=c(50, 150),'poisson'=c(50, 150),
   'binomial'=c(100,60))
q <- 6
sigmavec <- rep(1,3)
pvec <- unlist(pveclist)
datlist <- gendata_cmgfm(pveclist = pveclist, seed = 1, n = 300,d = 3,
                         q = q, rho = rep(1,length(pveclist)), rho_z=0.2,
                         sigmavec=sigmavec, sigma_eps=1)
XList <- datlist$XList
Z <- datlist$Z
numvarmat <- datlist$numvarmat
types <- datlist$types
rlist <- CMGFM(XList, Z, types=types, numvarmat, q=q)
str(rlist)


[Package CMGFM version 1.1 Index]