MoE_control | R Documentation |
Supplies a list of arguments (with defaults) for use with MoE_clust
.
MoE_control(init.z = c("hc", "quantile", "kmeans", "mclust", "random", "list"),
noise.args = list(...),
asMclust = FALSE,
equalPro = FALSE,
exp.init = list(...),
algo = c("EM", "CEM", "cemEM"),
criterion = c("bic", "icl", "aic"),
stopping = c("aitken", "relative"),
z.list = NULL,
nstarts = 1L,
eps = .Machine$double.eps,
tol = c(1e-05, sqrt(.Machine$double.eps), 1e-08),
itmax = c(.Machine$integer.max, .Machine$integer.max, 1000L),
hc.args = list(...),
km.args = list(...),
posidens = TRUE,
init.crit = c("bic", "icl"),
warn.it = 0L,
MaxNWts = 1000L,
verbose = interactive(),
...)
init.z |
The method used to initialise the cluster labels for the non-noise components. Defaults to Other options include When When Finally, when the model includes expert network covariates and |
noise.args |
A list supplying select named parameters to control inclusion of a noise component in the estimation of the mixture. If either or both of the arguments
In particular, the argument The arguments |
asMclust |
The default values of
|
equalPro |
Logical variable indicating whether or not the mixing proportions are to be constrained to be equal in the model. Default: |
exp.init |
A list supplying select named parameters to control the initialisation routine in the presence of expert network covariates (otherwise ignored):
|
algo |
Switch controlling whether models are fit using the |
criterion |
When either |
stopping |
The criterion used to assess convergence of the EM/CEM algorithm. The default ( Both stopping rules are ultimately governed by |
z.list |
A user supplied list of initial cluster allocation matrices, with number of rows given by the number of observations, and numbers of columns given by the range of component numbers being considered. In particular, |
nstarts |
The number of random initialisations to use when Conversely, if |
eps |
A scalar tolerance associated with deciding when to terminate computations due to computational singularity in covariances. Smaller values of |
tol |
A vector of length three giving relative convergence tolerances for 1) the log-likelihood of the EM/CEM algorithm, 2) parameter convergence in the inner loop for models with iterative M-step ( |
itmax |
A vector of length three giving integer limits on the number of iterations for 1) the EM/CEM algorithm, 2) the inner loop for models with iterative M-step ( The default is If, for any model with gating covariates, the multinomial logistic regression in the gating network fails to converge in |
hc.args |
A list supplying select named parameters to control the initialisation of the cluster allocations when
|
km.args |
A list supplying select named parameters to control the initialisation of the cluster allocations when
|
posidens |
A logical governing whether to continue running the algorithm even in the presence of positive log-densities. Defaults to |
init.crit |
The criterion to be used to determine the optimal model type to initialise with, when |
warn.it |
A single number giving the iteration count at which a warning will be printed if the EM/CEM algorithm has failed to converge. Defaults to |
MaxNWts |
The maximum allowable number of weights in the call to |
verbose |
Logical indicating whether to print messages pertaining to progress to the screen during fitting. By default is |
... |
Catches unused arguments. |
MoE_control
is provided for assigning values and defaults within MoE_clust
and MoE_stepwise
.
While the criterion
argument controls the choice of the optimal number of components and GPCM/mclust model type, MoE_compare
is provided for choosing between fits with different combinations of covariates or different initialisation settings.
A named list in which the names are the names of the arguments and the values are the values supplied to the arguments.
Note that successfully invoking exp.init$clustMD
(though it defaults to FALSE
) affects the role of the arguments init.z
, hc.args
, and km.args
. Please read the documentation above carefully in this instance.
The initial allocation matrices before and after the invocation of the exp.init
related arguments are both stored as attributes in the object returned by MoE_clust
(named "Z.init"
and "Exp.init"
, respectively). If init.z="random"
and nstarts > 1
, the allocations corresponding to the best random start are stored (regardless of whether exp.init$estart
is invoked or not). This can be useful for supplying z.list
for future fits.
Keefe Murphy - <keefe.murphy@mu.ie>
MoE_clust
, MoE_stepwise
, aitken
, Mclust
, hc
, mclust.options
, quant_clust
, clustMD
, noise_vol
, hypvol
, convhulln
, ellipsoidhull
, MoE_compare
, multinom
ctrl1 <- MoE_control(criterion="icl", itmax=100, warn.it=15, init.z="random", nstarts=5)
data(CO2data)
GNP <- CO2data$GNP
res <- MoE_clust(CO2data$CO2, G=2, expert = ~ GNP, control=ctrl1)
# Alternatively, specify control arguments directly
res2 <- MoE_clust(CO2data$CO2, G=2, expert = ~ GNP, stopping="relative")
# Supplying ctrl1 without naming it as 'control' can throw an error
## Not run:
res3 <- MoE_clust(CO2data$CO2, G=2, expert = ~ GNP, ctrl1)
## End(Not run)
# Similarly, supplying control arguments via a mix of the ... construct
# and the named argument 'control' also throws an error
## Not run:
res4 <- MoE_clust(CO2data$CO2, G=2, expert = ~ GNP, control=ctrl1, init.z="kmeans")
## End(Not run)
# Initialise via the mixed-type joint distribution of response & covariates
# Let the ICL criterion determine the optimal clustMD model type
# Constrain the mixing proportions to be equal
ctrl2 <- MoE_control(exp.init=list(clustMD=TRUE), init.crit="icl", equalPro=TRUE)
data(ais)
library(clustMD)
res4 <- MoE_clust(ais[,3:7], G=2, modelNames="EVE", expert= ~ sex,
network.data=ais, control=ctrl2)
# Include a noise component by specifying its prior mixing proportion
res5 <- MoE_clust(ais[,3:7], G=2, modelNames="EVE", expert= ~ sex,
network.data=ais, tau0=0.1)
# Investigate the use of random starts
sex <- ais$sex
# resA uses deterministic starting values (by default) for each G value
system.time(resA <- MoE_clust(ais[,3:7], G=2, expert=~sex, equalPro=TRUE))
# resB passes each random start through the entire EM algorithm for each G value
system.time(resB <- MoE_clust(ais[,3:7], G=2, expert=~sex, equalPro=TRUE,
init.z="random", nstarts=10))
# resC passes only the "best" random start through the EM algorithm for each G value
system.time(resC <- MoE_clust(ais[,3:7], G=2, expert=~sex, equalPro=TRUE,
init.z="random", nstarts=10, estart=TRUE))
# Here, all three settings (listed here in order of speed) converge to the same model
MoE_compare(resA, resC, resB)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.