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. TRUE (1) indicates exact lifetime is known, FALSE (0) indicates that the corresponding failure time is right censored.

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 type.t=1 or type.t=3.

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 type.c = 4.

b.eps

Numeric. Scale parameter for the prior gamma distribution of epsilon when type.c = 4.

type.c

1=assigns c.r a zero-entry vector; 2=lets the user define c.r freely; 3=assigns c.r an exponential prior distribution with mean 1; 4=assigns c.r an exponential hierarchical distribution with mean epsilon which in turn has a Ga(a.eps, b.eps) distribution.

epsilon

Double. Mean of the exponential distribution assigned to c.r when type.c = 3

iterations

Integer. Number of iterations including the burn.in to be computed for the Markov chain.

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 TRUE, prints out the execution time.

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)




[Package BGPhazard version 2.1.1 Index]