lcmCR_PostSampl: Generate Samples from the Posterior Distribution of...

View source: R/Lcm_CR_fn.R

lcmCR_PostSamplR Documentation

Generate Samples from the Posterior Distribution of Population Size under a LCMCR Model

Description

Convenience function for generate samples from the posterior distribution of the population size using an initialized lcm_CR_Basic object.

Usage

lcmCR_PostSampl(object, burnin = 10000, samples = 1000, thinning = 10, 
    clear_buffer = FALSE, output = TRUE)

Arguments

object

an initialized lcm_CR_Basic object.

burnin

number of burn in iterations.

samples

Nnmber of samples to be generated. Note that this is not the same as the number of iterations for the sampler. Samples are saved one every thinning iterations.

thinning

subsampling interval. Samples are saved one every thinning iterations.

clear_buffer

logical. Clear the tracing buffer before sampling?

output

logical. Print messages?

Value

A vector with the samples posterior samples of the population size parameter.

Warning

Invoking this function deletes the content of the object's tracing buffer.

Note

To create and initialize the lcm_CR_Basic object use lcmCR or lcm_CR_Basic_generator. The user is responsible to check whether the chain has reached the stationary distribution or not.

Author(s)

Daniel Manrique-Vallier

Examples

data(kosovo_aggregate)
sampler <- lcmCR(captures = kosovo_aggregate, tabular = FALSE, in_list_label = '1',
      not_in_list_label = '0', K = 10, a_alpha = 0.25, b_alpha = 0.25, seed = 'auto')
N <- lcmCR_PostSampl(sampler, burnin = 10000, samples = 1000, thinning = 100, output = FALSE)
quantile(N, c(0.025, 0.5, 0.975))

LCMCR documentation built on May 31, 2023, 8:11 p.m.