mptmix {psychomix} | R Documentation |
Finite Mixtures of Multinomial Processing Tree Models
Description
Fit finite mixtures of multinomial processing tree (MPT) models via maximum likelihood with the EM algorithm.
Usage
mptmix(formula, data, k, subset, weights,
nrep = 3, cluster = NULL, control = NULL,
verbose = TRUE, drop = TRUE, unique = FALSE, which = NULL,
spec, treeid = NULL,
optimargs = list(control = list(reltol =
.Machine$double.eps^(1/1.2), maxit = 1000)), ...)
FLXMCmpt(formula = . ~ ., spec = NULL, treeid = NULL, optimargs = NULL, ...)
Arguments
formula |
Symbolic description of the model (of type |
data , subset |
Arguments controlling formula processing. |
k |
A vector of integers indicating the number of components of
the finite mixture; passed in turn to the |
weights |
An optional vector of weights to be used in the fitting
process; passed in turn to the |
nrep |
Number of runs of the EM algorithm. |
cluster |
Either a matrix with |
control |
An object of class |
verbose |
A logical; if |
drop |
A logical; if |
unique |
A logical; if |
which |
number of model to get if |
spec , treeid , optimargs |
arguments for the MPT model passed on to
|
... |
Currently not used. |
Details
Internally stepFlexmix
is called with suitable arguments to fit the finite mixture model with
the EM algorithm.
FLXMCmpt
is the flexmix
driver for
MPT mixture models.
The interface is designed along the same lines as raschmix
which is introduced in detail in Frick et al. (2012). However, the
mptmix
function has not yet been fully tested and may change in
future versions.
The latent-class MPT model (Klauer, 2006) is equivalent to an MPT mixture model without concomitant variables.
MPT models are specified using the mptspec
function. See the
documentation in the mpt package for details.
Value
Either an object of class "mptmix"
containing the best model
with respect to the log-likelihood (if k
is a scalar) or the
one selected according to which
(if specified and k
is a
vector of integers longer than 1) or an object of class
"stepMPTmix"
(if which
is not specified and k
is a
vector of integers longer than 1).
References
Frick, H., Strobl, C., Leisch, F., and Zeileis, A. (2012). Flexible Rasch Mixture Models with Package psychomix. Journal of Statistical Software, 48(7), 1–25. http://www.jstatsoft.org/v48/i07/
Klauer, K.C. (2006). Hierarchical Multinomial Processing Tree Models: A Latent-Class Approach. Psychometrika, 71, 7–31. doi: 10.1007/s11336-004-1188-3
See Also
Examples
## Data
data("PairClustering", package = "psychotools")
pc <- reshape(PairClustering, timevar = "trial", idvar = "ID",
direction = "wide")
## Latent-class MPT model (Klauer, 2006)
suppressWarnings(RNGversion("3.5.0"))
set.seed(1)
m <- mptmix(as.matrix(pc[-1]) ~ 1, data = pc, k = 1:3,
spec = mptspec("SR", .replicates = 2))
m1 <- getModel(m, which = "BIC")
## Inspect results
summary(m1)
parameters(m1)
plot(m1)
library(lattice)
xyplot(m1)