fitCV_SparseDOSSA2: Fit SparseDOSSA 2 model to a microbiome abundance dataset...

View source: R/SparseDOSSA2_fit.R

fitCV_SparseDOSSA2R Documentation

Fit SparseDOSSA 2 model to a microbiome abundance dataset with cross validation

Description

fitCV_SparseDOSSA2 randomly partitions the data into fitting and testing subsets. It fits the SparseDOSSA 2 model to the fitting sets and uses log likelihood of the fitted parameters in the testing sets as the criteria for selection of tuning parameter lambda.

Usage

fitCV_SparseDOSSA2(
  data,
  lambdas = 10^seq(-2, 0, length.out = 5),
  K = 5,
  control = list()
)

Arguments

data

feature-by-sample matrix of abundances (proportions or counts).

lambdas

vector of positive penalization parameters for the sparsity of feature-feature correlations. The function fits SparseDOSSA 2 models to each of the lambda values, and uses cross validation likelihood to select the optimal one. If not provided this will be chosen automatically.

control

a named list of additional control parameters. See help page for control_fit.

Value

a list, with the following components:

EM_fit

list of fitted parameters from the EM algorithm, with additional cross validation likelihood.

F_fit

fitted parameters for the joint distribution of per-feature prevalence, abundance, and variability parameters (for simulating new features)

depth_fit

fitted parameters for the read depth distribution. Only applicable to count data.

l_filtering

list of quality control filtering for sample and features.

Author(s)

Siyuan Ma, syma.research@gmail.com

Examples

data("Stool_subset")
fitted <- fitCV_SparseDOSSA(data = Stool_subset,
                            lambdas = c(0.1, 1),
                            K = 5)


biobakery/SparseDOSSA2 documentation built on Dec. 3, 2024, 10:17 p.m.