BeMRes {BGPhazard} | R Documentation |
Markov Beta Model
Description
Posterior inference for the Bayesian non-parametric Markov beta model for discrete survival times.
Usage
BeMRes(
times,
delta = rep(1, length(times)),
alpha = rep(1e-04, K),
beta = rep(1e-04, K),
c.r = rep(0, K - 1),
a.eps = 0.1,
b.eps = 0.1,
type.c = 4,
epsilon = 1,
iterations = 2000,
burn.in = floor(iterations * 0.2),
thinning = 5,
printtime = TRUE
)
Arguments
times |
Numeric positive vector. Failure times. |
delta |
Logical vector. Status indicator. |
alpha |
Nonnegative vector. Small entries are recommended in order to specify a non-informative prior distribution. |
beta |
Nonnegative vector. Small entries are recommended in order to specify a non-informative prior distribution. |
c.r |
Nonnegative vector. The higher the entries, the higher the correlation of two consecutive failure times. |
a.eps |
Numeric. Shape parameter for the prior gamma distribution of
epsilon when |
b.eps |
Numeric. Scale parameter for the prior gamma distribution of
epsilon when |
type.c |
Integer. 1=defines |
epsilon |
Double. Mean of the exponential distribution assigned to
|
iterations |
Integer. Number of iterations including the |
burn.in |
Integer. Length of the burn-in period for the Markov chain. |
thinning |
Integer. Factor by which the chain will be thinned. Thinning the Markov chain is to reduces autocorrelation. |
printtime |
Logical. If |
Details
Computes the Gibbs sampler given by the full conditional distributions of u and Pi (Nieto-Barajas & Walker, 2002) and arranges the resulting Markov chain into a tibble which can be used to obtain posterior summaries.
Note
It is recommended to verify chain's stationarity. This can be done by checking each partition element individually. See BePlotDiag.
References
- Nieto-Barajas, L. E. & Walker, S. G. (2002). Markov beta and gamma processes for modelling hazard rates. Scandinavian Journal of Statistics 29: 413-424.
See Also
Examples
## Simulations may be time intensive. Be patient.
## Example 1
# data(psych)
# timesP <- psych$time
# deltaP <- psych$death
# BEX1 <- BeMRes(timesP, deltaP, iterations = 3000, burn.in = 300, thinning = 1)
## Example 2
# data(gehan)
# timesG <- gehan$time[gehan$treat == "control"]
# deltaG <- gehan$cens[gehan$treat == "control"]
# BEX2 <- BeMRes(timesG, deltaG, type.c = 2, c.r = rep(50, 22))