GaMRes {BGPhazard} | R Documentation |
Markov Gamma Model
Description
Computes the Gibbs sampler given by the full conditional distributions of U, Lambda, C and Epsilon (Nieto-Barajas & Walker, 2002) and arranges the resulting Markov chain into a tibble which can be used to obtain posterior summaries.
Usage
GaMRes(
times,
delta = rep(1, length(times)),
type.t = 3,
K = 5,
utao = NULL,
alpha = rep(0.01, K),
beta = rep(0.01, K),
c.r = rep(1, (K - 1)),
c.nu = 1,
a.eps = 0.1,
b.eps = 0.1,
type.c = 4,
epsilon = 1,
iterations = 1000,
burn.in = floor(iterations * 0.2),
thinning = 5,
printtime = TRUE
)
Arguments
times |
Numeric positive vector. Failure times. |
delta |
Logical vector. Status indicator. |
type.t |
Integer. 1=computes uniformly-dense intervals; 2= partition arbitrarily defined by the user with parameter utao and 3=same length intervals. |
K |
Integer. Partition length for the hazard function if
|
utao |
vector. Partition specified by the user when type.t = 2. The first value of the vector has to be 0 and the last one the maximum observed time, either censored or uncensored. |
alpha |
Nonnegative entry vector. Small entries are recommended in order to specify a non-informative prior distribution. |
beta |
Nonnegative entry 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 intervals. |
c.nu |
Tuning parameter for the proposal distribution for c. |
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 |
1=assigns |
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 reducec autocorrelation. |
printtime |
Logical. If |
Details
Posterior inference for the Bayesian non-parametric Markov gamma model in survival analysis.
Examples
## Simulations may be time intensive. Be patient.
## Example 1
data(gehan)
timesG <- gehan$time[gehan$treat == "6-MP"]
deltaG <- gehan$cens[gehan$treat == "6-MP"]
GEX1 <- GaMRes(timesG, deltaG, K = 8, iterations = 3000)
## Example 2
data(leukemiaFZ)
timesFZ <- leukemiaFZ$time
deltaFZ <- leukemiaFZ$delta
GEX2 <- GaMRes(timesFZ, deltaFZ, type.c = 4)