emAllFeatures: emAllFeatures(known,unknown,p=rep(.2,5),maxiter=2000,conv=.00001)

Description Usage Arguments Value Author(s) Examples

View source: R/emAllFeatures.R

Description

This function performs the Expectation-Maximization Algorithm to estimate a vector of class proportions for a single feature in a data set wih an unknown set of class proportions. Called by featureMixtureProportion.

Usage

1
2
emAllFeatures(known, unknown, p = rep(0.2, 5), maxiter = 2000,
  conv = 1e-05)

Arguments

known

A data set with class as the first column. This data set has known class proportions.

unknown

A data set whose proportions will be estimated. This data set may have class as the first column, to return an MSE to compare the estimates to the actual proportions.

p

Vector of class starting proportion estimates. Default is .2 for 5 classes.

maxiter

Maximum number of iterations of the EM algorithm allowed. Default is 2000.

conv

Convergence criteria for change in likelihood function. Change between

Value

A list containing the following components:

p = vector of estimated mixing proportions for the unknown data set.

iter = number of iterations before EM algorithm converged or was stopped.

allp = (iter x 5) data frame containing all phat iterated estimates.

logl = Vector of log-likelihood values, with one log-lik value for each iteration.

mse = MSE of actual unknown class proportions (if in data set) versus estimated.

Author(s)

Jennifer Starling

Examples

1
2
## Define ctrl object.
em <- emAllFeatures(df1,df2,p=rep(.2,5),maxiter=1000,conv=.00001)

jstarling1/starlib documentation built on May 20, 2019, 2:12 a.m.