simulate.mpt

0th

Percentile

Simulate Responses from MPT Models

Simulates responses from the distribution corresponding to a fitted mpt model object.

Keywords
models
Usage
# S3 method for mpt
simulate(object, nsim, seed, pool = TRUE, …)
Arguments
object

an object of class mpt, typically the result of a call to mpt.

nsim, seed

currently not used.

pool

logical, if TRUE (default), pooled responses (summed across respondents) are returned.

further arguments passed to or from other methods. None are used in this method.

Details

Responses are simulated by (repeatedly) applying rmultinom with sizes taken from the original sample and probabilities computed from the model object.

Value

A named vector of (pooled) responses. Names identify the tree from which responses were simulated.

See Also

mpt, rmultinom.

Aliases
  • simulate.mpt
Examples
# NOT RUN {
data(retroact)
 
m <- mpt(mptspec(
  c*r,
  (1 - c)*u^2,
  2*(1 - c)*u*(1 - u),
  c*(1 - r) + (1 - c)*(1 - u)^2,
  u,
  1 - u
), retroact[retroact$lists == 1, ])

simulate(m)

## Parametric bootstrap of goodness-of-fit test
LR.stat <- replicate(200, deviance(mpt(m$spec, simulate(m))))

hist(LR.stat, border="white", freq=FALSE, breaks=20,
     main="Parametric bootstrap")
curve(dchisq(x, df=1), add=TRUE)
abline(v=deviance(m), lty=2)
# }
Documentation reproduced from package mpt, version 0.6-2, License: GPL (>= 2)

Community examples

Looks like there are no examples yet.