Learn R Programming

JointAI (version 0.1.0)

add_samples: Add samples to an object of class JointAI

Description

Allows to continue sampling from an existing object of class JointAI

Usage

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

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 for monitors

monitor_params

named vector specifying which parameters should be monitored, see details.

progress.bar

type of progress bar. Possible values are "text", "gui", and "none". See Details.

Examples

Run this code
# NOT RUN {
mod <- lm_imp(y~C1 + C2 + M2, data = wideDF, n.iter = 100)
mod_add <- add_samples(mod, n.iter = 200, add = TRUE)

# or to additionally sample imputed values
imps <- add_samples(mod, n.iter = 200, monitor_params = c("imps" = TRUE),
                    add = FALSE)


# }

Run the code above in your browser using DataLab