MCMCDepGammaIntermediate {BayesSurvival} | R Documentation |
This is the sampler for the intermediate intervals (= all intervals except for the first and last one) in case the piecewise exponential prior with dependent Gamma heights is selected. The sampler is described in the Supplement to Castillo and Van der Pas (2020) and uses MCMC within Gibbs, with a Gamma proposal with shape parameter equal to the number of events in the interval plus some epsilon (to prevent proposals equal to zero if there are no events in an interval) and rate parameter equal to the parameter alpha (set by the user) divided by histogram height on the previous interval, plus the total amount of time all individuals were exposed during this interval. Most users of the package will not work with this function directly, but instead use the main function BayesSurv, in which this particular function is incorporated.
MCMCDepGammaIntermediate( current, prev.haz, next.haz, failure, exposure, alpha.dep )
current |
The value of the height of the first interval from the previous iteration. |
prev.haz |
The value of the height of the preceding interval from the previous iteration. |
next.haz |
The value of the height of the next interval from the previous iteration. |
failure |
The number of individuals who had an event during the first interval. |
exposure |
The total amount of time all individuals were exposed for during the first interval. |
alpha.dep |
The main parameter α for the dependent Gamma
prior, as described in the documentation for BayesSurv. It is
recommended to take |
res |
A new sample of the histogram height of the selected interval. |
Castillo and Van der Pas (2020). Multiscale Bayesian survival analysis. <arXiv:2005.02889>.
BayesSurv, which computes the posterior mean and credible bands for the cumulative hazard and survival functions, as well as the posterior mean for the hazard. Within BayesSurv, the present function as well as MCMCDepGammaFirst is called through SamplePosteriorDepGamma.