ztruncnorm: Fit a zero-inflated censored normal distribution.

Description Usage Arguments Details Value Author(s)

View source: R/fit_ztrunc.R

Description

Fit each gene expression by a zero-inflated censored normal distribution by direct maximize the log-likelihood and return MLE of mean, variance and probability of mixture component.

Usage

1
2
3
4
5
6
7
8
9
ztruncnorm(
  dat,
  cutoff = 0.1,
  iter = 200,
  s_upper = 4,
  s_lower = 0.1,
  p_min = 0.6,
  p_max = 1
)

Arguments

dat

Data matrix.

cutoff

The value below cutoff is treated as no expression. Default = 0.1.

iter

Max number of iteration for optimization. Default = 100.

s_upper

upper bound of standard deviation. Default = 4.

s_lower

lower bound of standard deviation. Default = 0.1.

p_min

lower bound of the probability of the normal component. Default = 0.6.

p_max

upper bound of the probability of the normal component. Can be either a scaler or a vector. If it is a vector, each element is the upper bound for a gene. Default = 1.

Details

It will return NA if number of nonzero is less than 4 indicating that the gene has no expression or if the optimization is not convergence or error which will be filled with sample mean and std, p_max afterwards.

Value

ztruncnorm returns a list of results in the following order.

  1. paramA matrix with mean and standard deviation for each gene.

  2. pgA vector for the probablity of the normal component.

Author(s)

Zhirui Hu, zhiruihu@g.harvard.edu

Songpeng Zu, songpengzu@g.harvard.edu


JunLiuLab/SIMPLEs documentation built on March 18, 2021, 3:10 a.m.