doCountMStep: Compute the Maximization step calculation for features still...

View source: R/doCountMStep.R

doCountMStepR Documentation

Compute the Maximization step calculation for features still active.

Description

Maximization step is solved by weighted least squares. The function also computes counts residuals.

Usage

doCountMStep(z, y, mmCount, stillActive, fit2 = NULL, dfMethod = "modified")

Arguments

z

Matrix (m x n) of estimate responsibilities (probabilities that a count comes from a spike distribution at 0).

y

Matrix (m x n) of count observations.

mmCount

Model matrix for the count distribution.

stillActive

Boolean vector of size M, indicating whether a feature converged or not.

fit2

Previous fit of the count model.

dfMethod

Either 'default' or 'modified' (by responsibilities)

Details

Maximum-likelihood estimates are approximated using the EM algorithm where we treat mixture membership $delta_ij$ = 1 if $y_ij$ is generated from the zero point mass as latent indicator variables. The density is defined as $f_zig(y_ij = pi_j(S_j)*f_0(y_ij) +(1-pi_j (S_j)) * f_count(y_ij;mu_i,sigma_i^2)$. The log-likelihood in this extended model is $(1-delta_ij) log f_count(y;mu_i,sigma_i^2 )+delta_ij log pi_j(s_j)+(1-delta_ij)log (1-pi_j (s_j))$. The responsibilities are defined as $z_ij = pr(delta_ij=1 | data)$.

Value

Update matrix (m x n) of estimate responsibilities (probabilities that a count comes from a spike distribution at 0).

See Also

fitZig


HCBravoLab/metagenomeSeq documentation built on March 17, 2024, 3:21 p.m.