e_step_mn: Computed expected log likelihood of multinomial mixture

Description Usage Arguments Value

View source: R/em.R

Description

Given an n x p matrix of count data x, as well as a p x k matrix of probabilities p, return the responsibilities of each sample for the k groups in a n x k matrix. If x has any non-integer values, they are rounded to the nearest integer.

Usage

1
e_step_mn(x, p, mc, Llks = NULL, labels = NULL)

Arguments

x

sparseMatrix. A sample by feature matrix of counts.

p

numeric matrix. A feature by group matrix of probabilities.

mc

numeric. Mixture coefficients

Llks

If log likelihood was computed for the mixture, provide the matrix here.

labels

Numeric vector of same length as number of rows in x. Fixes the group probabilities of the integer in this vector element to 1. In other words, the latent variable for these samples are treated as known.

Value

a numeric matrix with n samples by k groups.


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