Skip to contents

Continues MCMC sampling without recompilation, using the NIMBLE Cmcmc$run(niter, reset = FALSE) pattern.

Usage

dpmirt_resume(fit_or_compiled, niter_more, reset = FALSE, verbose = TRUE, ...)

Arguments

fit_or_compiled

A dpmirt_samples, dpmirt_fit, or dpmirt_compiled object.

niter_more

Integer. Number of additional iterations.

reset

Logical. FALSE to continue from current state (default), TRUE to restart.

verbose

Logical. Print progress messages.

...

Additional arguments.

Value

A dpmirt_samples object with extended samples. Pass the returned object to dpmirt_rescale before using fit methods such as summary(), plot(), or dpmirt_estimates().

Details

Resume requires the original live compiled NIMBLE object; saved RDS objects cannot restore compiled external pointers. Multi-chain fitted objects cannot be continued with reset = FALSE; use reset = TRUE for a fresh single-chain restart or rerun dpmirt.

Examples

if (FALSE) { # \dontrun{
# Continue from a previous fit for more iterations
fit <- dpmirt(sim$response, model = "rasch", prior = "normal",
              niter = 5000, nburnin = 1000)
resumed <- dpmirt_resume(fit, niter_more = 5000)
fit2 <- dpmirt_rescale(resumed)
summary(fit2)
} # }