BPSpriorSample: Function to Sample Hazard Rates from BPS Priors

Description Usage Arguments Details Value See Also Examples

Description

A function to generate a random sample of hazard rates from a first order autoregrssive BPS prior distribution.

Usage

1
BPSpriorSample(ss = 1, hyp = BPSpriorElicit())

Arguments

ss

requested sample size

hyp

list of hyperparameters (as generated by BPSpriorElicit)

Details

A random sample of ss hazard rates is extracted from the first order autoregressive BPS prior distribution identified by hyp.

Value

A list with two components:

hyp

list of hyperparameters identifying the BPS prior distribution from which the sample was extracted (copy of the input argument)

eta

matrix with ss rows (and length(hyp$knots)-hyp$ord columns) containing the spline weights

See Also

BPSevalHR, BPSplotHR

Examples

1
2
3
4
5
6
7
8
# set RNG seed (for example reproducibility only)
set.seed(1234)

# select a BPS prior distribution
hypars<-BPSpriorElicit(r0 = 0.1, H = 1, T00 = 50, ord = 4, G = 3, c = 0.9)

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

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