run_em: Run EM to estimate parameters of mixture model

View source: R/em.R

run_emR Documentation

Run EM to estimate parameters of mixture model

Description

Estimate the parameters of the mixture model, and estimate the posterior probability a droplet belongs to each of the clusters.

Usage

run_em(x, A = NULL, P = NULL, Z = NULL, model = "mltn",
  alpha_prior = 0, pi_prior = 0, max_iter = 1000, eps = 1e-04,
  psc = 1e-10, threads = 1, verbose = TRUE)

Arguments

x

An SCE object.

A

Initial alpha parameter.

P

Initial pi parameter.

Z

Initial latent variable Z values.

model

The mixture model to assume. Can be either "DM" for a Dirichlet-multinomial or "mltn" for a multinomial.

alpha_prior

Add a non-informative prior by adding a count of alpha_prior to all genes in each cluster. Only valid for the multinomial model.

pi_prior

Add a non-informative prior by adding a count of pi_prior to the each cluster's membership.

max_iter

Maximum number of iterations for the EM estimation of the mixture model.

eps

The delta threshold for when to call convergence for the EM estimation of the mixture model. The EM stops when delta falls below this value. We define delta as the average change in posterior probability. By default this is set to 1e4, so that the EM converges when less than 1 in 10,000 labels change on average.

psc

Pseudocount to add to avoid collapsing likelihood to 0.

threads

Number of threads for parallel execution. Default is 1.

verbose

Verbosity.

Value

An SCE object.


marcalva/diem documentation built on Jan. 1, 2023, 2:33 a.m.