fit.CP: Fit compound Poisson mixed effect models (CPMM) for one or...

Description Usage Arguments Value Examples

View source: R/HeriTools.R

Description

Fit a CPMM for one or more features and output the fit parameters. It is used before the function computeVPC.CP(). This function also allows to test the presence of heritability via random effect variance of the model.

Usage

1
fit.CP(CountMatrix, Strains, test = FALSE, optimizer = "nlminb")

Arguments

CountMatrix

Sequencing count matrix for one or more features. Each row is for one feature, and the columns are for samples.

Strains

Strain labels for the samples.

test

TRUE or FALSE (default). Test the presence of heritability through examining the random effect variance .

optimizer

A character string that determines which optimization routine is to be used. Possible choices are "nlminb" (default), "L-BFGS-B", and "bobyqa".

Value

A list with two objects. The first object is a G x 4 matrix indicating the fitted parameters for each feature. The columns are ordered by intercept α_g, tweedie parameter p_g, random effect variance σ^2_g, and dispersion φ_g. Row names are feature names. If the argument test is set to be true, the second object of the list consists of p-values for testing the hypothesis that random effects sigma_a2 = 0; otherwise, the second object is NULL.

Examples

1
2
3
4
5
6
7
## Fit CPMM for the first two features and test the presence of 
## heritability. 
result.cp <- fit.CP(simData[1:2, ], strains, test = TRUE)
## Extract parameters
para.cp <- result.cp[[1]]
## Extract p-values
pval.cp <- result.cp[[2]]

HeritSeq documentation built on July 13, 2021, 1:06 a.m.

Related to fit.CP in HeritSeq...