Description Usage Arguments Details Value Note References See Also Examples
A function to generate a random sample of hazard rates from the posterior distribution originated by a CPP prior through the observation of a sequence of possibly right censored times to event.
1 | CPPpostSample(hyp, times, obs = NULL, mclen = 10, burnin = 0, thin = 1, lab = FALSE)
|
hyp |
list of hyperparameters (as generated by |
times |
vector of (possibly right censored) times to event |
obs |
vector of censoring indicators (0 = censored, 1 = exact) |
mclen |
requested sample size |
burnin |
burn-in parameter |
thin |
thinning parameter |
lab |
logical: should latent labels be returned? |
A random scan (random start) Gibbs sampler (with slice sampling updating of jump-times)
is used to generate a Markov chain sample of length mclen
from the posterior distribution
originated by hyp
through the observation of times
and obs
; see La Rocca (2005).
The first burnin
states of the Markov chain are discarded, then one every thin
is kept.
If obs
is NULL
, it is assumed that all observations are exact (no censoring).
A list with eight components:
hyp |
list of hyperparameters identifying the CPP prior that originated the posterior distribution from which the sample was extracted (copy of the input argument) |
dat |
dataframe with two variables ( |
burnin |
burn-in parameter used (copy of the input argument) |
thin |
thinning parameter used (copy of the input argument) |
sgm |
matrix with |
xi0 |
matrix with |
csi |
matrix with |
gam |
matrix with |
The latent label γ_i is equal to j when the i-th time to event is associated with the j-th CPP jump; it is only defined for exact observations, but for censored observations it is conventionally set equal to -1.
Luca La Rocca (2005). On Bayesian Nonparametric Estimation of Smooth Hazard Rates with a View to Seismic Hazard Assessment. Research Report n. 38-05, Department of Social, Cognitive and Quantitative Sciences, Reggio Emilia, Italy.
BayHaz-package
, CPPevalHR
, CPPplotHR
, CPPpost2mcmc
1 2 3 4 5 6 7 8 9 10 | # 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)
# load a data set
data(earthquakes)
# generate a posterior sample
post<-CPPpostSample(hypars, times = earthquakes$ti, obs = earthquakes$ob)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.