View source: R/multinomial_em.R
multinomial_em | R Documentation |
Implement the EM algorithm for multivariate multinomial data given observed counts of complete and missing data (Y_obs and Y_mis). Allows for specification of a Dirichlet conjugate prior.
multinomial_em( x_y, z_Os_y, enum_comp, n_obs, conj_prior = c("none", "data.dep", "flat.prior", "non.informative"), alpha = NULL, tol = 5e-07, max_iter = 10000, verbose = FALSE )
x_y |
A |
z_Os_y |
A |
enum_comp |
A |
n_obs |
An integer specifying the number of observations in the original data. |
conj_prior |
A string specifying the conjugate prior. One of
|
alpha |
The vector of counts α for a Dir(α) prior. Must be specified if
|
tol |
A scalar specifying the convergence criteria. Defaults to |
max_iter |
An integer specifying the maximum number of allowable iterations. Defaults
to |
verbose |
Logical. If |
An object of class mod_imputeMulti-class
.
multinomial_data_aug
, multinomial_impute
## Not run: data(tract2221) x_y <- multinomial_stats(tract2221[,1:4], output= "x_y") z_Os_y <- multinomial_stats(tract2221[,1:4], output= "z_Os_y") x_possible <- multinomial_stats(tract2221[,1:4], output= "possible.obs") imputeEM_mle <- multinomial_em(x_y, z_Os_y, x_possible, n_obs= nrow(tract2221), conj_prior= "none", verbose= TRUE) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.