hsaft {PanCanVarSel} | R Documentation |
Function to implement the horseshoe shrinkage prior in Bayesian survival regression
Description
This function employs the algorithm provided by van der Pas et. al. (2016) for log normal Accelerated Failure Rate (AFT) model to fit survival regression. The censored observations are updated according to the data augmentation of approach of Tanner and Wong (1984).
Usage
hsaft(ct, X, method.tau = c("fixed", "truncatedCauchy", "halfCauchy"),
tau = 1, method.sigma = c("fixed", "Jeffreys"), Sigma2 = 1,
burn = 1000, nmc = 5000, thin = 1, alpha = 0.05)
Arguments
ct |
Response, a |
X |
Matrix of covariates, dimension |
method.tau |
Method for handling |
tau |
Use this argument to pass the (estimated) value of |
method.sigma |
Select "Jeffreys" for full Bayes with Jeffrey's prior on the error
variance |
Sigma2 |
A fixed value for the error variance |
burn |
Number of burn-in MCMC samples. Default is 1000. |
nmc |
Number of posterior draws to be saved. Default is 5000. |
thin |
Thinning parameter of the chain. Default is 1 (no thinning). |
alpha |
Level for the credible intervals. For example, alpha = 0.05 results in 95% credible intervals. |
Details
The model is:
t_i
is response,
c_i
is censored time,
t_i^* = \min_(t_i, c_i)
is observed time,
w_i
is censored data, so w_i = \log t_i^*
if t_i
is event time and
w_i = \log t_i^*
if t_i
is right censored
\log t_i=X\beta+\epsilon, \epsilon \sim N(0,\sigma^2)
Value
SurvivalHat |
Predictive survival probability. |
LogTimeHat |
Predictive log time. |
BetaHat |
Posterior mean of Beta, a |
LeftCI |
The left bounds of the credible intervals. |
RightCI |
The right bounds of the credible intervals. |
BetaMedian |
Posterior median of Beta, a |
Sigma2Hat |
Posterior mean of error variance |
TauHat |
Posterior mean of global scale parameter tau, a positive scalar. If method.tau = "fixed" is used, this value will be equal to the user-selected value of tau passed to the function. |
BetaSamples |
Posterior samples of Beta. |
TauSamples |
Posterior samples of tau. |
Sigma2Samples |
Posterior samples of Sigma2. |
LikelihoodSamples |
Posterior Samples of likelihood. |
References
Stephanie van der Pas, James Scott, Antik Chakraborty and Anirban Bhattacharya (2016). horseshoe: Implementation of the Horseshoe Prior. R package version 0.1.0. https://CRAN.R-project.org/package=horseshoe
Arnab Kumar Maity, Anirban Bhattacharya, Bani K. Mallick, and Veerabhadran Baladandayuthapani (2017). Joint Bayesian Estimation and Variable Selection for TCPA Protein Expression Data
Examples
burnin <- 500 # number of burnin
nmc <- 1000 # number of Markov Chain samples
y.sd <- 1 # standard deviation of the data
p <- 80 # number of covariates
n <- 40 # number of samples
beta <- as.vector(smoothmest::rdoublex(p)) # from double exponential distribution
x <- mvtnorm::rmvnorm(n, mean = rep(0, p)) # from multivariate normal distribution
y.mu <- x %*% beta # mean of the data
y <- as.numeric(stats::rnorm(n, mean = y.mu, sd = y.sd)) # from normal distribution
T <- exp(y) # AFT model
C <- rgamma(n, shape = 1.75, scale = 3) # censoring time
time <- pmin(T, C) # observed time is min of censored and true
status = time == T # set to 1 if event is observed
ct <- as.matrix(cbind(time = time, status = status)) # censored time
posterior.fit <- hsaft(ct, x, method.tau = "truncatedCauchy", method.sigma = "Jeffreys",
burn = burnin, nmc = nmc)
summary(posterior.fit$BetaHat)