Skip to main content

Multinomial Processing Tree (MPT) Model Fitting Function

Description

mptmodel is a basic fitting function for multinomial processing tree (MPT) models.

Usage

mptmodel(y, weights = NULL, spec, treeid = NULL,
  optimargs = list(control = list(reltol = .Machine\$double.eps^(1/1.2),
                                  maxit = 1000),
                   init = NULL),
  start = NULL, vcov = TRUE, estfun = FALSE, ...)

Arguments

y matrix of response frequencies.
weights an optional vector of weights (interpreted as case weights).
spec an object of class mptspec: typically result of a call to mptspec. A symbolic description of the model to be fitted.
treeid a factor that identifies each tree in a joint multinomial model.
optimargs a list of arguments passed to the optimization function (optim).
start a vector of starting values for the parameter estimates between zero and one.
vcov logical. Should the estimated variance-covariance be included in the fitted model object?
estfun logical. Should the empirical estimating functions (score/gradient contributions) be included in the fitted model object?
… further arguments passed to functions.

Details

mptmodel provides a basic fitting function for multinomial processing tree (MPT) models, intended as a building block for fitting MPT trees in the psychotree package. While mptmodel is intended for individual response frequencies, the mpt package provides functions for aggregate data.

MPT models are specified using the mptspec function. See the documentation in the mpt package for details.

mptmodel returns an object of class “mptmodel” for which several basic methods are available, including print, plot, summary, coef, vcov, logLik, estfun and predict.

Value

mptmodel returns an S3 object of class “mptmodel”, i.e., a list with components as follows:

y a matrix with the response frequencies,
coefficients estimated parameters (for extraction, the coef function is preferred),
loglik log-likelihood of the fitted model,
npar number of estimated parameters,
weights the weights used (if any),
nobs number of observations (with non-zero weights),
ysum the aggregate response frequencies,
fitted, goodness.of.fit, … see mpt in the mpt package.

See Also

btmodel, pcmodel, gpcmodel, rsmodel, raschmodel, nplmodel, mptspec, the mpt package

Examples

library("psychotools")

o <- options(digits = 4)

## data
data("SourceMonitoring", package = "psychotools")

## source-monitoring MPT model
mpt1 <- mptmodel(SourceMonitoring$y, spec = mptspec("SourceMon"))
summary(mpt1)

Coefficients:
   Estimate Logit Estim. Std. Error z value Pr(>|z|)    
D1    0.614       0.4651     0.0556    8.37   <2e-16 ***
d1    0.379      -0.4927     0.1828   -2.70    0.007 ** 
g     0.535       0.1392     0.0779    1.79    0.074 .  
b     0.172      -1.5687     0.0427  -36.72   <2e-16 ***
D2    0.675       0.7292     0.0568   12.84   <2e-16 ***
d2    0.425      -0.3031     0.1428   -2.12    0.034 *  
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Likelihood ratio G2: 0 on 0 df, p-value: 1 
AIC: 12478
Number of trees: 3 
plot(mpt1)

options(digits = o$digits)