CPPpriorSample: Function to Sample Hazard Rates from CPP Priors

Description Usage Arguments Details Value See Also Examples

Description

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

Usage

1
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

1
2
3
4
5
6
7
8
# 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)

BayHaz documentation built on May 2, 2019, 7:07 a.m.