run_em: Run EM on counts to estimate multinomial mixture model

Description Usage Arguments Value

View source: R/em.R

Description

Run expectation maximization (EM) to estimate the parameters of the multinomial mixture model. This function takes an SCE object as input, and returns an SCE object with the EM output. The number of clusters and their initialized multinomial means are taken from the initial clustering assignments calculated with initialize_clusters. The EM algorithm is run by repeatedly updating the membership probabilities and then estimating the MLE parameters of the multinomial mixture model. The algorithm converges when the percent change in the log likihood is less than eps. If the algorithm doesn't converge by max_iter, it breaks off. The posterior probability is the calculated by taking the sum of the likelihood fractions across the cell types.

Usage

1
2
run_em(x, eps = 1e-08, max_iter = 1000, psc = 1e-04,
  verbose = TRUE)

Arguments

x

An SCE object.

eps

Numeric threshold. The EM algorithm converges when the percent change in log likihood is less than eps.

max_iter

The maximum number of iterations allowed to run.

psc

Pseudocount to add to multinomial parameters to avoid collapsing likelihood to 0.

verbose

Logical indicating verbosity.

Value

An SCE object.


diem documentation built on Nov. 16, 2019, 1:08 a.m.