Usage
glmcwm (Y, Xcont=NULL, Xcate=NULL, m=NULL, familyY="Gaussian", k=2,
mY=1, method="Nelder-Mead", initialization="random.soft", start.z=NULL,
iter.max=1000, threshold=1.0e-04,loglikplot, seed=NULL)
Arguments
Y
numerical vector for the response variable.
Xcont
matrix for the continuous covariates.
Xcate
matrix for the categorical covariates.
m
number of levels for each categorical variable in Xcate (starting by 1).
familyY
the exponential distribution used for Y|x in each cluster; it can be:
"Gaussian""Poisson""Binomial""Gamma"
Default value is "Gaussian". k
a vector containing the numbers of clusters to be tried. The one with the lowest information criterion is selected. Default value is 2.
mY
When familyY="Binomial", it sets the sample size. Default value is 1 (Bernoulli distribution).
method
optimization method used in the M-step of the EM algorithm (see optim). Default value is "Nelder-Mead". initialization
initialization strategy for the EM-algorithm. It can be:
"random.soft""random.hard""manual"
Default value is "random.soft". start.z
matrix of soft or hard classification: it is used only if initialization="manual".
iter.max
maximum number of iterations in the EM-algorithm. Default value is 200.
threshold
threshold for Aitken acceleration procedure. Default value is 1.0e-04.
loglikplot
if TRUE, the log-likelihood values against the iterations are plotted. Default value FALSE.
seed
the seed for the random number generator, when random initializations are used; if NULL, current seed is not changed. Default value is NULL.