View source: R/posteriorPredictive.R
posteriorPredictive | R Documentation |
Draw predicted frequencies based on posterior distribution of (a) individual estimates (default) or (b) for a new participant (if numItems
is provided; does not consider continuous or discrete predictors in traitMPT).
posteriorPredictive(
fittedModel,
M = 100,
numItems = NULL,
expected = FALSE,
nCPU = 4
)
fittedModel |
fitted latent-trait or beta MPT model ( |
M |
number of posterior predictive samples. As a maximum, the number of posterior samples in |
numItems |
optional: a vector with the number of items per MPT tree to sample predicted data for a new participant (first, a participant vector |
expected |
if |
nCPU |
number of CPUs used for parallel sampling. For large models and many participants, this requires considerable computer-memory resources (as a remedy, use |
by default, a list of M
posterior-predictive samples (i.e., matrices) with individual frequencies (rows=participants, columns=MPT categories). For M=1
, a single matrix is returned. If numItems
is provided, a matrix with samples for a new participant is returned (rows=samples)
## Not run:
# add posterior predictive samples to fitted model
# (facilitates plotting using ?plotFit)
fittedModel$postpred$freq.pred <-
posteriorPredictive(fittedModel, M = 1000)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.