Usage
cwm(formulaY = NULL, familyY = gaussian, data, Xnorm = NULL, Xbin = NULL,
Xpois = NULL, Xmult = NULL, modelXnorm = NULL, Xbtrials = NULL, k = 1:3,
initialization = c("random.soft", "random.hard", "kmeans", "mclust", "manual"),
start.z = NULL, seed = NULL, maxR = 1, iter.max = 1000, threshold = 1.0e-04,
eps = 1e-100, parallel = FALSE)Arguments
formulaY
an optional object of class "formula" (or one that can be coerced to that class): a symbolic description of the model to be fitted. familyY
a description of the error distribution and link function to be used for the conditional distribution of $Y$ in each mixture component. This can be a character string naming a family function Xnorm, Xbin, Xpois, Xmult
an optional matrix containing variables to be used for marginalization having normal, binomial, Poisson and multinomial distributions.
modelXnorm
an optional vector of character strings indicating the parsimonious models to be fitted for variables in Xnorm. The default is c("E", "V") for a single continuous covariate, and c("EII", "VII", "EEI", "VEI", "EVI", "VVI",
Xbtrials
an optional vector containing the number of trials for each column in Xbin. If omitted, the maximum of each column in Xbin is used.
k
an optional vector containing the numbers of mixture components to be tried. Default value is 1:3.
initialization
an optional character string. It sets the initialization strategy for the EM-algorithm. It can be:
"random.soft""random.hard""kmeans""mclust""manual"<
start.z
matrix of soft or hard classification: it is used only if initialization = "manual".
seed
an optional scalar. It sets the seed for the random number generator, when random initializations are used; if NULL, current seed is not changed. Default value is NULL.
maxR
number of initializations to be tried. Default value is 1.
iter.max
an optional scalar. It sets the maximum number of iterations in the EM-algorithm. Default value is 200.
threshold
an optional scalar. It sets the threshold for the Aitken acceleration procedure. Default value is 1.0e-04.
eps
an optional scalar. It sets the smallest value for eigenvalues of covariance matrices for Xnorm. Default value is 1e-100.
parallel
When TRUE, the package parallel is used for parallel computation. When several models are estimated, computational time is reduced. The number of cores to use may be s