DtracePLN: Estimate the sparse precision matrix for PLN model.

View source: R/DtracePLN.R

DtracePLNR Documentation

Estimate the sparse precision matrix for PLN model.

Description

Estimate the precision matrix for PLN model by estimating the covariance matrix using moment method and estimating the precision matrix using the dtrace loss.

Usage

DtracePLN(
  obs_mat,
  Sd_est = "TSS",
  lambda_vec = NULL,
  n_lambda = 100,
  lambda_valuemax0 = 10
)

Arguments

obs_mat

An abundance count matrix with Cell rows and Gene columns.

Sd_est

Optional. Normalisation scheme used to compute scaling factors used as offset during PLN inference. Available schemes are "TSS" (Total Sum Scaling, default), "CSS" (Cumulative Sum Scaling, used in metagenomeSeq), "GMPR" (Geometric Mean of Pairwise Ratio, introduced in Chen et al., 2018) or "none". Alternatively the user can supply its own vector or matrix of offsets (see note for specification of the user-supplied offsets).

lambda_vec

Optional. The user can supply its own vector.

n_lambda

Optional. When the lambda_vec is empty, the package will provide a suitable lambda_vec with length n_lambda.

lambda_valuemax0

Optional. When the lambda_vec is NULL, the package will provide a suitable lambda_vec searching from lambda_valuemax0.

Value

A list which contain the following result:

Omega_est

A list which contain the precision matrix for different lambda value.

lambda_vec

The lambda_vec used.

S_depth

The vector of estimated library size.

BIC_vec

The vector of BIC value.

Omega_chooseB

The estimated precision matrix choosed by the BIC criterion.

AIC_vec

The vector of AIC value.

Omega_chooseA

The estimated precision matrix choosed by the AIC criterion.

time_sigmamoment

The time for calculating the covariance matrix for PLN using moment method.

time_EQUAL

The time for calculating the path of precision matrix using EQUAL package.

References

Zhang T, Zou H. Sparse precision matrix estimation via lasso penalized D-trace loss[J]. Biometrika, 2014, 101(1): 103-120.

Examples


##
library(MASS)
library(CVXR)
library(EQUAL)

##
# Run DtracePLN
dtracePLN_res<-DtracePLN::DtracePLN(obs_mat = DtracePLN::obs_mat,
Sd_est = "TSS",lambda_vec = NULL , n_lambda =100 , lambda_valuemax0 = 10)



git-tjj/DtracePLN documentation built on Jan. 30, 2023, 1:47 a.m.