dmmn: Compute density of multinomial mixture for a matrix

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 probabilities 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
dmmn(x, p, mc, labels = NULL)

Arguments

x

A sparseMatrix that is a sample by feature matrix of counts.

p

Matrix with probability parameters of multinomials for each group. Number of rows must be same as number of columns in X

mc

Numeric vector with mixture coefficients. Length must be same as number of columns in p.

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 containing log multinomial densities under the given parameters of the MMM.


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