BPSpriorSample {BayHaz} | R Documentation |
A function to generate a random sample of hazard rates from a first order autoregrssive BPS prior distribution.
BPSpriorSample(ss = 1, hyp = BPSpriorElicit())
ss |
requested sample size |
hyp |
list of hyperparameters (as generated by BPSpriorElicit ) |
A random sample of ss
hazard rates is extracted from the first order autoregressive BPS prior distribution
identified by hyp
.
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 |
# 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)