BNPdensity (version 2019.9.11)

compute_thinning_grid: Compute the grid for thinning the MCMC chain

Description

Compute the grid for thinning the MCMC chain

Usage

compute_thinning_grid(Nit, thinning_to = 10)

Arguments

Nit

Length of the MCMC chain

thinning_to

Desired number of iterations after thinning.

Value

an integer vector of the MCMC iterations retained.

Details

This function creates an real grid then rounds it. If the grid is fine enough, there is a risk that rounding ties, i.e. iteration which are kept twice. To avoid this, if the total number of iterations is smaller than twice the number of iterations desired after thinning, the chain is not thinned.