overdispersedGFM {GFM}R Documentation

Overdispersed Generalized Factor Model

Description

This function is to implement the overdispersed generalized factor model.

Usage

  overdispersedGFM(XList, types, q, offset=FALSE, epsELBO=1e-5,
                  maxIter=30, verbose=TRUE)

Arguments

XList

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.

types

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.

q

a positive integer or empty, specify the number of factors.

offset

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.

epsELBO

a positive real, specify the relative tolerance of ELBO function in the algorithm. Optional parameter with default as 1e-5.

maxIter

a positive integer, specify the times of iteration. Optional parameter with default as 30.

verbose

a logical value with TRUE or FALSE, specify whether ouput the information in iteration process, (optional) default as TRUE.

Details

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.

Value

return a list with class name 'overdispersedGFM' and including following components,

hH

a n*q matrix, the estimated factor matrix.

hB

a p*q matrix, the estimated loading matrix.

hmu

a p-dimensional vector, the estimated intercept terms.

obj

a real number, the value of objective function when the convergence achieves.

q

an integer, the used or estimated factor number.

history

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.

Note

nothing

Author(s)

Liu Wei

See Also

nothing

Examples


## 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')
measurefun(gfm2$hB, dat$B0, type='ccor')

[Package GFM version 1.2.1 Index]