Simulate responses from a fitted ordered / inflated ordered model
Source:R/simulate.R
simulate.iord.RdDraws nsim replicate response vectors from the fitted category
probabilities at the estimation data, in the format of
stats::simulate(). The main consumer is simulated-residual diagnostics:
sims <- simulate(fit, nsim = 250)
DHARMa::createDHARMa(simulatedResponse = as.matrix(sims),
observedResponse = fit$y,
fittedPredictedResponse = as.numeric(fitted(fit) %*% (0:(fit$J - 1))),
integerResponse = TRUE)Responses are returned as integers 0..J-1 (the internal category index;
fit$levels maps them to labels), which is what DHARMa expects.
Usage
# S3 method for class 'iord'
simulate(object, nsim = 1, seed = NULL, ...)Arguments
- object
An
"iord"object.- nsim
Number of replicate response vectors.
- seed
Optional seed, handled as in
stats::simulate().- ...
Unused.
See also
residuals.iord(), riop() for drawing from a chosen
data-generating process, predict.iord().
Other simulation and diagnostics:
iord-distribution,
residuals.iord(),
riop()