Generates an MCMC object with derived parameters from an MCMC object.
mcmc_derive(object, ...)# S3 method for nlist
mcmc_derive(
object,
expr,
values = list(),
monitor = ".*",
primary = FALSE,
silent = getOption("mcmcderive.silent", FALSE),
...
)
# S3 method for nlists
mcmc_derive(
object,
expr,
values = list(),
monitor = ".*",
primary = FALSE,
silent = getOption("mcmcderive.silent", FALSE),
...
)
# S3 method for mcmc
mcmc_derive(
object,
expr,
values = list(),
monitor = ".*",
primary = FALSE,
silent = getOption("mcmcderive.silent", FALSE),
...
)
# S3 method for mcmc.list
mcmc_derive(
object,
expr,
values = list(),
monitor = ".*",
primary = FALSE,
parallel = FALSE,
silent = getOption("mcmcderive.silent", FALSE),
...
)
# S3 method for mcmcr
mcmc_derive(
object,
expr,
values = list(),
monitor = ".*",
primary = FALSE,
parallel = FALSE,
silent = getOption("mcmcderive.silent", FALSE),
...
)
# S3 method for mcmcrs
mcmc_derive(
object,
expr,
values = list(),
monitor = ".*",
primary = FALSE,
parallel = FALSE,
silent = getOption("mcmcderive.silent", FALSE),
...
)
An MCMC object.
Unused.
A string of the R code defining the values of the derived parameter(s) with respect to the parameters in object.
A named list of additional R objects to evaluate in the R expression.
A regular expression specifying the derived parameter(s) in expr to monitor.
A flag specifying whether to include the original primary parameters in the new MCMC object.
A flag specifying whether to suppress messages and warnings.
A flag specifying whether to generate the derived parameters for each chain in parallel.
An MCMC object with the derived parameter(s).
nlist: Get derived parameters for an nlist::nlist-object()
nlists: Get derived parameters for an nlist::nlists-object()
mcmc: Get derived parameters for an coda::mcmc() object
mcmc.list: Get derived parameters for an coda::mcmc.list() object
mcmcr: Get derived parameters for an mcmcr::mcmcr-object()
mcmcrs: Get derived parameters for an mcmcr::mcmcrs-object()
It's important to note that parameters in the expression that also
occur in the original object are not included in the new object
unless primary = TRUE in which case they are simply copied from the
original object to the new one.
This applies even when the primary parameters are redefined in values.
# NOT RUN {
mcmcr::mcmcr_example
expr <- "
log(alpha2) <- alpha
gamma <- sum(alpha) * sigma"
mcmc_derive(mcmcr::mcmcr_example, expr, silent = TRUE)
# }
Run the code above in your browser using DataLab