Learn R Programming

MHadaptive (version 1.1-8)

mcmc_thin: Thin an MCMC object to reduce autocorrelation.

Description

This function reduces the autocorrelation of an MCMC run from Metro_Hastings() by retaining only every iterations of the chain.

Usage

mcmc_thin(mcmc_object, thin = 5)

Arguments

mcmc_object
object returned by a call to Metro_Hastings()
thin
integer: retain only every iterations of the MCMC.

Value

object (list) of the same type as that returned by a call to Metro_Hastings()

See Also

Metro_Hastings,BCI, plotMH

Examples

Run this code
data(mcmc_r)
## Thin the results of a simple Bayesian linear regression
mcmc_rTHINNED<-mcmc_thin(mcmc_r) 
plotMH(mcmc_rTHINNED)

Run the code above in your browser using DataLab