JointAI (version 0.5.1)

add_samples: Add samples to an object of class JointAI

Description

Allows to continue sampling from an existing object of class 'JointAI'. When the original sample was created using parallel computation, the separate 'jags' objects will be recompiled and sampling will again be performed in parallel.

Usage

add_samples(object, n.iter, add = TRUE, thin = NULL,
  monitor_params = NULL, progress.bar = "text", mess = TRUE)

Arguments

object

object inheriting from class 'JointAI'

n.iter

number of iterations to monitor

add

logical; should the new MCMC samples be added to the existing samples or replace them? If samples are added, thin and var.names are ignored.

thin

thinning interval (see window.mcmc)

monitor_params

named vector specifying which parameters should be monitored

progress.bar

character string specifying the type of progress bar. Possible values are "text", "gui", and "none". See update.

mess

logical; should messages be given? Default is TRUE. Note: this applies only to messages given directly by JointAI.

See Also

lm_imp, glm_imp, lme_imp, clm_imp glme_imp, clmm_imp, survreg_imp, coxph_imp

The vignette Parameter Selection contains some examples how to specify the argument monitor_params.

Examples

Run this code
# NOT RUN {
# Example 1:
# Run an initial JointAI model:
mod <- lm_imp(y~C1 + C2 + M2, data = wideDF, n.iter = 100)

# Continue sampling:
mod_add <- add_samples(mod, n.iter = 200, add = TRUE)


# Example 2:
# Continue sampling, but additionally sample imputed values.
# Note: Setting different parameters to monitor than in the original model
# requires add = FALSE.
imps <- add_samples(mod, n.iter = 200, monitor_params = c("imps" = TRUE),
                    add = FALSE)

# }

Run the code above in your browser using DataLab