scissors: Remove the first n iterations.

View source: R/MCMC.R

scissorsR Documentation

Remove the first n iterations.

Description

Removes iterations of the MCMC time series, and then updates the output file.

Usage

scissors(burnin, set = get("info"), write = TRUE, save.info = TRUE)

Arguments

burnin

Number of iterations to remove of the iterative time series. If this value is higher than the amount of remaining iterations, a warning is given and the iterations are not removed. If the provided number is negative, the iterations will be removed from the end of the run, not from the start. If a range is given, this range of iterations is removed.

set

Detailed information of the current run, stored within this session's memory as variable info.

write

Whether or not to write the changes to the output file. Defaults to TRUE.

save.info

By default, a variable called ‘info’ with relevant information about the run (e.g., core name, priors, settings, ages, output) is saved into the working directory. Note that this will overwrite any existing variable with the same name - as an alternative, one could run, e.g., myvar <- Bacon(), followed by supplying the variable myvar in any subsequent commands.

Details

Bacon will perform millions of MCMC iterations for each age-model run by default, although only a fraction of these will be stored. In most cases the remaining MCMC iterations will be well mixed (the upper left panel of the fit of the iterations shows no undesirable features such as trends or sudden systematic drops or rises). If the run has a visible remaining burn-in, scissors can be used to remove them. To remove, e.g., the first 300 iterations, type scissors(300). To remove the last 300 iterations, type scissors(-300). To remove iterations 300 to 600, type scissors(300:600).

Value

NA

Author(s)

Maarten Blaauw, J. Andres Christen

Examples


  Bacon(ask=FALSE, coredir=tempfile())
  nrow(info$output)
  scissors(100)
  nrow(info$output)



rbacon documentation built on Sept. 30, 2024, 9:40 a.m.