Learn R Programming

BayHaz (version 0.1-3)

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

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

Details

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

See Also

CPPevalHR, CPPplotHR

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)

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

Run the code above in your browser using DataLab