Learn R Programming

bstrl (version 1.0.2)

thinsamples: Thin a bstrlstate object

Description

Thin a bstrlstate object by keeping only one sample every n, until the desired count remains.

Usage

thinsamples(state, count)

Value

An object of class bstrlstate, containing count samples.

Arguments

state

Object of class bstrlstate, output by bipartiteRL, SMCMCupdate, PPRBupdate, or multifileRL

count

The number of desired samples after filtering

Details

This is useful to do before an SMCMC update. SMCMC produces independent samples, so fewer are required to get the same quality estimates.

Examples

Run this code
data(geco_small_result)
filtered <- thinsamples(geco_small_result, 50)
stopifnot(ncol(filtered$Z) == 50)

Run the code above in your browser using DataLab