thin: Thin an MCMC sample

View source: R/thin.R

thinR Documentation

Thin an MCMC sample

Description

Thins the output from an MCMC process

Usage

thin(x, k)

Arguments

x

A vector, matrix or data.frame containing output from an MCMC sampling scheme

k

An integer. This function takes every kth element from x

Details

Note this function does not check to see if k is sensible.

Value

A thinned vector, matrix or data frame containing every kth element of x.

Examples


## A blockwise Metropolis-Hastings chain of 1000 elements, thinned to
## 5th element
##

MCMCSampleBW = bivnormMH(0.9, type = 'block')
MCMCSampleBW = thin(MCMCSampleBW, 5)


Bolstad2 documentation built on April 11, 2022, 5:08 p.m.

Related to thin in Bolstad2...