Learn R Programming

BayHaz (version 0.1-3)

CPPpost2mcmc: Function to Convert CPP Posterior Samples into MCMC Objects

Description

A function to convert a CPP posterior sample into an MCMC object, so that package 'coda' can be used for output diagnostics.

Usage

CPPpost2mcmc(sampost)

Arguments

sampost
posterior sample of CPP hazard rates (as generated by CPPpostSample)

Value

See Also

BayHaz-package, CPPpostSample

Examples

Run this code
# set RNG seed (for example reproducibility only)
set.seed(1234)

# select a CPP prior distribution
hypars<-CPPpriorElicit(r0 = 0.1, H = 1, T00 = 50, M00 = 2)
# load a data set
data(earthquakes)
# generate a posterior sample
post<-CPPpostSample(hypars, times = earthquakes$ti, obs = earthquakes$ob)

# convert the posterior sample into an MCMC object
MCMCpost<-CPPpost2mcmc(post)

Run the code above in your browser using DataLab