Learn R Programming

LCMCR (version 0.4.14)

lcmCR_PostSampl: 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)

Value

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

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?

Author

Daniel Manrique-Vallier

Warning

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

Examples

Run this code
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))

Run the code above in your browser using DataLab