RR_COAP: Fit the COAP model

View source: R/main.R

RR_COAPR Documentation

Fit the COAP model

Description

Fit the covariate-augmented overdispersed Poisson factor model

Usage

RR_COAP(
  X_count,
  multiFac = rep(1, nrow(X_count)),
  Z = matrix(1, nrow(X_count), 1),
  rank_use = 5,
  q = 15,
  epsELBO = 1e-05,
  maxIter = 30,
  verbose = TRUE,
  joint_opt_beta = FALSE,
  fast_svd = TRUE
)

Arguments

X_count

a count matrix, the observed count matrix.

multiFac

an optional vector, the normalization factor for each unit; default as full-one vector.

Z

an optional matrix, the covariate matrix; default as a full-one column vector if there is no additional covariates.

rank_use

an optional integer, specify the rank of the regression coefficient matrix; default as 5.

q

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

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.

joint_opt_beta

a logical value, whether use the joint optimization method to update bbeta. The default is FALSE, which means using the separate optimization method.

fast_svd

a logical value, whether use the fast SVD algorithm in the update of bbeta; default is TRUE.

Details

None

Value

return a list including the following components: (1) H, the predicted factor matrix; (2) B, the estimated loading matrix; (3) bbeta, the estimated low-rank large coefficient matrix; (4) invLambda, the inverse of the estimated variances of error; (5) H0, the factor matrix; (6) ELBO: the ELBO value when algorithm stops; (7) ELBO_seq: the sequence of ELBO values.

References

Liu, W. and Q. Zhong (2024). High-dimensional covariate-augmented overdispersed poisson factor model. arXiv preprint arXiv:2402.15071.

See Also

None

Examples

n <- 300; p <- 100
d <- 20; q <- 6; r <- 3
datlist <- gendata_simu(n=n, p=p, d=20, q=q, rank0=r)
str(datlist)
fitlist <- RR_COAP(X_count=datlist$X, Z = datlist$Z, q=6, rank_use=3)
str(fitlist)

COAP documentation built on May 29, 2024, 5:06 a.m.