pmcmc_thin: Thin a pmcmc chain

View source: R/pmcmc_tools.R

pmcmc_thinR Documentation

Thin a pmcmc chain

Description

Thin results of running pmcmc(). This function may be useful before using pmcmc_predict(), or before saving pmcmc output to disk. pmcmc_thin takes every thin'th sample, while pmcmc_sample randomly selects a total of n_sample samples.

Usage

pmcmc_thin(object, burnin = NULL, thin = NULL)

pmcmc_sample(object, n_sample, burnin = NULL)

Arguments

object

Results of running pmcmc()

burnin

Optional integer number of iterations to discard as "burn-in". If given then samples 1:burnin will be excluded from your results. It is an error if this is not a positive integer or is greater than or equal to the number of samples (i.e., there must be at least one sample remaining after discarding burnin).

thin

Optional integer thinning factor. If given, then every thin'th sample is retained (e.g., if thin is 10 then we keep samples 1, 11, 21, ...). Note that this can produce surprising results as it will always select the first sample but not necessarily always the last.

n_sample

The number of samples to draw from object with replacement. This means that n_sample can be larger than the total number of samples taken (though it probably should not)


mrc-ide/mcstate documentation built on July 3, 2024, 1:34 p.m.