overdispersedGFM.Rd
This function is to implement the overdispersed generalized factor model.
overdispersedGFM(XList, types, q, offset=FALSE, epsELBO=1e-5,
maxIter=30, verbose=TRUE)
a list consisting of matrices with the same rows n, and different columns (p1,p2, ..., p_d),observational mixed data matrix list, d is the types of variables, p_j is the dimension of varibles with the j-th type.
a d-dimensional character vector, specify the type of variables. For example, types=c('gaussian','poisson', 'binomial')
, implies the components of XList
are matrices with continuous, count and binomial values, respectively.
a positive integer or empty, specify the number of factors.
a logical value, whether add an offset term (the total counts for each row in the count component of XList) when there are Poisson variables.
a positive real, specify the relative tolerance of ELBO function in the algorithm. Optional parameter with default as 1e-5
.
a positive integer, specify the times of iteration. Optional parameter with default as 30.
a logical value with TRUE or FALSE, specify whether ouput the information in iteration process, (optional) default as TRUE.
Overdispersion is prevalent in practical applications, particularly in fields like biomedical and genomics studies. To address this practical demand, we propose an overdispersed generalized factor model (OverGFM) for performing high-dimensional nonlinear factor analysis on overdispersed mixed-type data.
return a list with class name 'overdispersedGFM' and including following components,
a n*q matrix, the estimated factor matrix.
a p*q matrix, the estimated loading matrix.
a p-dimensional vector, the estimated intercept terms.
a real number, the value of objective function when the convergence achieves.
an integer, the used or estimated factor number.
a list including the following 7 components: (1)dB: the varied quantity of B in each iteration; (2)dH: the varied quantity of H in each iteration; (3)dc: the varied quantity of the objective function in each iteration; (4)c: the objective value in each iteration; (5) realIter: the real iterations to converge; (6)maxIter: the tolerance of maximum iterations; (7)elapsedTime: the elapsed time.
nothing
nothing
## mix of normal and Poisson
dat <- gendata(seed=1, n=60, p=60, type='norm_pois', q=2, rho=2)
## we set maxIter=2 for example.
gfm2 <- overdispersedGFM(dat$XList, dat$types, q=2, verbose = FALSE, maxIter=2)
measurefun(gfm2$hH, dat$H0, type='ccor')
#> [1] 0.9774377
measurefun(gfm2$hB, dat$B0, type='ccor')
#> [1] 0.9507307