EM: Estimate a mixture model using an EM algorithm

Description Usage Arguments Details

View source: R/EM.R

Description

Estimate a mixture model using an EM algorithm

Usage

1
2
3
4
EM(formula, data, penalization = 0, munCol = j, zCol = Z,
  yearCol = year, stateCol = state, tol = 0.001, mixTrace = 1,
  mixMaxit = 1000, pool = T, k = 10, nSamples = NULL,
  parallel = F, seed = NULL, cl = NULL, ...)

Arguments

formula

a formula expression as for regression models, of pooled form cbind(y1, y2, y3) ~ .

data

a data.frame in which to interpret the variables occurring in formula

penalization

a scalar between 0 and 1 to penalize observations whose type is unobserved. 1 discards those observations, 0 gives them weight equal to observations whose type is observed.

munCol

column in both data and dataMun containing the municipality id, syntax as in dplyr

zCol

column in both data and dataMun containing the (possibly missing) municipality type, syntax as in dplyr

yearCol

column in data containing the year, syntax as in dplyr

stateCol

column in data containing the state, syntax as in dplyr

tol

threshold used to determined convergence

mixTrace

report each mixTrace iteration Leave NULL for no reporting.

pool

should data be pooled automatically?

k

rounding parameter for numerical stability. Rounds to the order of log(-k)

nSamples

number of bootstrap replicates. If NULL, standard errors are not estimated.

parallel

should the bootstrap be parallelized? if TRUE, the cl argument shoud not be NULL

seed

optional seed

cl

cluster used for parallelization

...

additional parameters passed on to multinom

mixMaxIt

maximum number of iterations

Details

Make sure to check the methods man page to see related methods, as well as the posteriorprobs man page for how to deal with predicted probabilities.


rferrali/rogali documentation built on May 26, 2019, 7 p.m.