CPPpriorSample {BayHaz}R Documentation

Function to Sample Hazard Rates from CPP Priors

Description

A function to generate a random sample of hazard rates from a CPP prior distribution.

Usage

CPPpriorSample(ss = 1, hyp = CPPpriorElicit())

Arguments

ss requested sample size
hyp list of hyperparameters (as generated by CPPpriorElicit)

Details

A random sample of ss hazard rates is extracted from the CPP prior distribution identified by hyp.

Value

A list with four components:

hyp list of hyperparameters identifying the CPP prior distribution from which the sample was extracted (copy of the input argument)
sgm matrix with ss rows (and hyp$F columns) containing the CPP jump-times
xi0 matrix with ss rows (and just one column) containing the jump-sizes in the origin
csi matrix with ss rows (and hyp$F columns) containing the CPP jump-sizes

See Also

CPPevalHR, CPPplotHR

Examples

# 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)

# generate a sample of ten hazard rates
prior<-CPPpriorSample(ss = 10, hyp = hypars)

[Package BayHaz version 0.1-3 Index]