Title: Variational Bayesian Analysis of Survival Data
Version: 0.0.2
Description: Implements Bayesian inference in accelerated failure time (AFT) models for right-censored survival times assuming a log-logistic distribution. Details of the variational Bayes algorithms, with and without shared frailty, are described in Xian et al. (2024) <doi:10.1007/s11222-023-10365-6> and Xian et al. (2024) <doi:10.48550/arXiv.2408.00177>, respectively.
URL: https://github.com/chengqianxian/survregVB
License: MIT + file LICENSE | LGPL-2
Encoding: UTF-8
RoxygenNote: 7.3.2
Imports: stats, bayestestR, invgamma
Suggests: knitr, rmarkdown, testthat (≥ 3.0.0), survival
Config/testthat/edition: 3
VignetteBuilder: knitr
Depends: R (≥ 3.5)
LazyData: true
NeedsCompilation: no
Packaged: 2025-06-22 20:06:34 UTC; alisonzhang
Author: Alison Zhang [aut, cre], Chengqian Xian [aut]
Maintainer: Alison Zhang <alisonxzhang@gmail.com>
Repository: CRAN
Date/Publication: 2025-06-22 20:30:02 UTC

Calculates parameter \Sigma^* of q^*(\beta) to optimize the evidence based lower bound (ELBO) in survregVB.fit.

Description

Calculates parameter \Sigma^* of q^*(\beta) to optimize the evidence based lower bound (ELBO) in survregVB.fit.

Usage

Sigma_star(y, X, delta, v_0, alpha, omega, mu, expectation_b)

Arguments

y

A vector of observed log-transformed survival times.

X

A design matrix including covariates with first column of ones to represent the intercept.

delta

A binary vector indicating right censoring.

v_0

The precision (inverse variance) hyperparameter v_0, of the prior distribution of the vector of coefficients, \beta.

alpha

The shape parameter \alpha^* of q^*(b).

omega

The scale parameter \omega^* of q^*(b).

mu

Parameter \mu^* of q^*(\beta), a vector of means.

expectation_b

The expected value of b.

Value

Parameter \Sigma^* of q^*(\beta).

See Also

survregVB.fit


Calculates parameter \Sigma^* of q^*(\beta) to optimize the evidence based lower bound (ELBO) in survregVB.frailty.fit.

Description

Calculates parameter \Sigma^* of q^*(\beta) to optimize the evidence based lower bound (ELBO) in survregVB.frailty.fit.

Usage

Sigma_star_cluster(
  y,
  X,
  delta,
  v_0,
  alpha,
  omega,
  mu,
  tau,
  expectation_b,
  cluster
)

Arguments

y

A vector of observed log-transformed survival times.

X

A design matrix including covariates with first column of ones to represent the intercept.

delta

A binary vector indicating right censoring.

v_0

The precision (inverse variance) hyperparameter v_0, of the prior distribution of the vector of coefficients, \beta.

alpha

The shape parameter \alpha^* of q^*(b).

omega

The scale parameter \omega^* of q^*(b).

mu

Parameter \mu^* of q^*(\beta), a vector of means.

tau

Parameter \tau^* of q^*(\gamma_i), a vector of means.

expectation_b

The expected value of b.

cluster

A numeric vector indicating the cluster assignment for each observation.

Value

Parameter \Sigma^* of q^*(\beta).

See Also

survregVB.frailty.fit


Calculates parameter \alpha^* of q^*(b) to optimize the evidence based lower bound (ELBO) in survregVB.fit and survregVB.frailty.fit.

Description

Calculates parameter \alpha^* of q^*(b) to optimize the evidence based lower bound (ELBO) in survregVB.fit and survregVB.frailty.fit.

Usage

alpha_star(alpha_0, delta)

Arguments

alpha_0

The shape hyperparameter \alpha_0 of the prior distribution of the scale parameter, b.

delta

A binary vector indicating right censoring.

Value

Parameter \alpha^* of q^*(b).

See Also

survregVB.fit

survregVB.frailty.fit


Subset of rhDNase from the survival package

Description

The dnase dataset is a subset of the rhDNase dataset from the survival package. It is included in this package under the LGPL (\geq2) license.

Usage

dnase

Format

A data frame with 767 observations on the following variables:

trt

treatment arm: 0=placebo, 1= rhDNase

fev

forced expriatory volume at enrollment, a measure of lung capacity

infect

an infection that required the use of intravenous antibiotics

time

difference between the date of entry into the study and the date of last follow-up capped at 169 days

Source

survival package. https://cran.r-project.org/package=survival


Calculates the variational Bayes convergence criteria, evidence lower bound (ELBO), optimized in survregVB.fit.

Description

Calculates the variational Bayes convergence criteria, evidence lower bound (ELBO), optimized in survregVB.fit.

Usage

elbo(
  y,
  X,
  delta,
  alpha_0,
  omega_0,
  mu_0,
  v_0,
  alpha,
  omega,
  mu,
  Sigma,
  expectation_b
)

Arguments

y

A vector of observed log-transformed survival times.

X

A design matrix including covariates with first column of ones to represent the intercept.

delta

A binary vector indicating right censoring.

alpha_0

The shape hyperparameter \alpha_0 of the prior distribution of the scale parameter, b.

omega_0

The shape hyperparameter \omega_0 of the prior distribution of the scale parameter, b.

mu_0

Hyperparameter \mu_0, a vector of means, of the prior distribution of the vector of coefficients, \beta.

v_0

The precision (inverse variance) hyperparameter v_0, of the prior distribution of the vector of coefficients, \beta.

alpha

The shape parameter \alpha^* of q^*(b).

omega

The scale parameter \omega^* of q^*(b).

mu

Parameter \mu^* of q^*(\beta), a vector of means.

Sigma

Parameter \Sigma^* of q^*(\beta), a covariance matrix.

expectation_b

The expected value of b.

See Also

survregVB.fit


Calculates the variational Bayes convergence criteria, evidence lower bound (ELBO), optimized in survregVB.frailty.fit.

Description

Calculates the variational Bayes convergence criteria, evidence lower bound (ELBO), optimized in survregVB.frailty.fit.

Usage

elbo_cluster(
  y,
  X,
  delta,
  alpha_0,
  omega_0,
  mu_0,
  v_0,
  lambda_0,
  eta_0,
  alpha,
  omega,
  mu,
  Sigma,
  tau,
  sigma,
  lambda,
  eta,
  expectation_b,
  cluster
)

Arguments

y

A vector of observed log-transformed survival times.

X

A design matrix including covariates with first column of ones to represent the intercept.

delta

A binary vector indicating right censoring.

alpha_0

The shape hyperparameter \alpha_0 of the prior distribution of the scale parameter, b.

omega_0

The shape hyperparameter \omega_0 of the prior distribution of the scale parameter, b.

mu_0

Hyperparameter \mu_0, a vector of means, of the prior distribution of the vector of coefficients, \beta.

v_0

The precision (inverse variance) hyperparameter v_0, of the prior distribution of the vector of coefficients, \beta.

lambda_0

The shape hyperparameter \lambda_0 of the prior distribution of the frailty variance, \sigma_\gamma^2.

eta_0

The scale hyperparameter \eta_0 of the prior distribution of the frailty variance, \sigma_\gamma^2.

alpha

The shape parameter \alpha^* of q^*(b).

omega

The scale parameter \omega^* of q^*(b).

mu

Parameter \mu^* of q^*(\beta), a vector of means.

Sigma

Parameter \Sigma^* of q^*(\beta), a covariance matrix.

tau

Parameter \tau^* of q^*(\gamma_i), a vector of means.

sigma

Parameter \sigma^{2*}_i of q^*(\gamma_i), a vector of variance.

lambda

The shape parameter \lambda^* of q^*(\sigma^2_\gamma).

eta

The scale parameter \eta^* of q^*(\sigma^2_\gamma).

expectation_b

The expected value of b.

cluster

A numeric vector indicating the cluster assignment for each observation.

Value

The evidence lower bound (ELBO).

See Also

survregVB.fit


Calculates parameter \eta^* of q^*(\sigma^2_{\gamma}) to optimize the evidence based lower bound (ELBO) in survregVB.frailty.fit.

Description

Calculates parameter \eta^* of q^*(\sigma^2_{\gamma}) to optimize the evidence based lower bound (ELBO) in survregVB.frailty.fit.

Usage

eta_star(eta_0, tau, sigma)

Arguments

eta_0

The scale hyperparameter \eta_0 of the prior distribution of the frailty variance, \sigma_\gamma^2.

tau

Parameter \tau^* of q^*(\gamma_i), a vector of means.

sigma

Parameter \sigma^{2*}_i of q^*(\gamma_i), a vector of variance.

Value

Parameter \eta^* of q^*(\sigma^2_{\gamma}).

See Also

survregVB.frailty.fit


Calculates parameter \lambda^* of q^*(\sigma^2_{\gamma}) to optimize the evidence based lower bound (ELBO) in survregVB.frailty.fit.

Description

Calculates parameter \lambda^* of q^*(\sigma^2_{\gamma}) to optimize the evidence based lower bound (ELBO) in survregVB.frailty.fit.

Usage

lambda_star(lambda_0, K)

Arguments

lambda_0

The shape hyperparameter \lambda_0 of the prior distribution of the frailty variance, \sigma_\gamma^2.

K

The number of clusters.

Value

Parameter \lambda^* of q^*(\sigma^2_{\gamma}).

See Also

survregVB.frailty.fit


Subset of GSE102287: African American (AA) Patients

Description

This dataset is a subset of the GSE102287 dataset that includes only characteristics of patients who are identified as African American (AA).

Usage

lung_cancer

Format

A data frame with 60 observations on selected patient characteristics:

patient

Patient identification number.

age

Patient age.

Stage

Lung cancer stage (I, II, III).

time

Survival time in days.

gender

Gender of the patient.

smoking

0 = Never smoked, 1 = Has smoked.

status

0 = Alive, 1 = Death due to lung cancer.

Source

Gene Expression Omnibus (GEO), Accession: GSE102287. https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE102287

References

Mitchell, K. A., Zingone, A., Toulabi, L., Boeckelman, J., & Ryan, B. M. (2017). Comparative Transcriptome Profiling Reveals Coding and Noncoding RNA Differences in NSCLC from African Americans and European Americans. Clinical cancer research: an official journal of the American Association for Cancer Research, 23(23), 7412–7425. doi:10.1158/1078-0432.CCR-17-0527.


Calculates parameter \mu^* of q^*(\beta) to optimize the evidence based lower bound (ELBO) in survregVB.fit.

Description

Calculates parameter \mu^* of q^*(\beta) to optimize the evidence based lower bound (ELBO) in survregVB.fit.

Usage

mu_star(y, X, delta, mu_0, v_0, alpha, omega, mu, Sigma, expectation_b)

Arguments

y

A vector of observed log-transformed survival times.

X

A design matrix including covariates with first column of ones to represent the intercept.

delta

A binary vector indicating right censoring.

mu_0

Hyperparameter \mu_0, a vector of means, of the prior distribution of the vector of coefficients, \beta.

v_0

The precision (inverse variance) hyperparameter v_0, of the prior distribution of the vector of coefficients, \beta.

alpha

The shape parameter \alpha^* of q^*(b).

omega

The scale parameter \omega^* of q^*(b).

mu

Parameter \mu^* of q^*(\beta), a vector of means.

Sigma

Parameter \Sigma^* of q^*(\beta), a covariance matrix.

expectation_b

The expected value of b.

Value

Parameter \mu^* of q^*(\beta).

See Also

survregVB.fit


Calculates parameter \mu^* of q^*(\beta) to optimize the evidence based lower bound (ELBO) in survregVB.frailty.fit.

Description

Calculates parameter \mu^* of q^*(\beta) to optimize the evidence based lower bound (ELBO) in survregVB.frailty.fit.

Usage

mu_star_cluster(
  y,
  X,
  delta,
  mu_0,
  v_0,
  alpha,
  omega,
  mu,
  Sigma,
  tau,
  expectation_b,
  cluster
)

Arguments

y

A vector of observed log-transformed survival times.

X

A design matrix including covariates with first column of ones to represent the intercept.

delta

A binary vector indicating right censoring.

mu_0

Hyperparameter \mu_0, a vector of means, of the prior distribution of the vector of coefficients, \beta.

v_0

The precision (inverse variance) hyperparameter v_0, of the prior distribution of the vector of coefficients, \beta.

alpha

The shape parameter \alpha^* of q^*(b).

omega

The scale parameter \omega^* of q^*(b).

mu

Parameter \mu^* of q^*(\beta), a vector of means.

Sigma

Parameter \Sigma^* of q^*(\beta), a covariance matrix.

tau

Parameter \tau^* of q^*(\gamma_i), a vector of means.

expectation_b

The expected value of b.

cluster

A numeric vector indicating the cluster assignment for each observation.

Value

Parameter \mu^* of q^*(\beta)

See Also

survregVB.frailty.fit


Calculates parameter \omega^* of q^*(b) to optimize the evidence based lower bound (ELBO) in survregVB.fit.

Description

Calculates parameter \omega^* of q^*(b) to optimize the evidence based lower bound (ELBO) in survregVB.fit.

Usage

omega_star(y, X, delta, omega_0, mu, expectation_b)

Arguments

y

A vector of observed log-transformed survival times.

X

A design matrix including covariates with first column of ones to represent the intercept.

delta

A binary vector indicating right censoring.

omega_0

The shape hyperparameter \omega_0 of the prior distribution of the scale parameter, b.

mu

Parameter \mu^* of q^*(\beta), a vector of means.

expectation_b

The expected value of b.

Value

Parameter \omega^* of q^*(b).

See Also

survregVB.fit


Calculates parameter \omega^* of q^*(b) to optimize the evidence based lower bound (ELBO) in survregVB.frailty.fit.

Description

Calculates parameter \omega^* of q^*(b) to optimize the evidence based lower bound (ELBO) in survregVB.frailty.fit.

Usage

omega_star_cluster(y, X, delta, omega_0, mu, tau, expectation_b, cluster)

Arguments

y

A vector of observed log-transformed survival times.

X

A design matrix including covariates with first column of ones to represent the intercept.

delta

A binary vector indicating right censoring.

omega_0

The shape hyperparameter \omega_0 of the prior distribution of the scale parameter, b.

mu

Parameter \mu^* of q^*(\beta), a vector of means.

tau

Parameter \tau^* of q^*(\gamma_i), a vector of means.

expectation_b

The expected value of b.

cluster

A numeric vector indicating the cluster assignment for each observation.

Value

Parameter \omega^* of q^*(b).

See Also

survregVB.frailty.fit


Calculates parameter \sigma^{2*}_i of q^*(\gamma_i) for i=1,...,K clusters to optimize the evidence based lower bound (ELBO) in survregVB.frailty.fit.

Description

Calculates parameter \sigma^{2*}_i of q^*(\gamma_i) for i=1,...,K clusters to optimize the evidence based lower bound (ELBO) in survregVB.frailty.fit.

Usage

sigma_squared_star(
  y,
  X,
  delta,
  alpha,
  omega,
  mu,
  tau,
  lambda,
  eta,
  expectation_b,
  cluster
)

Arguments

y

A vector of observed log-transformed survival times.

X

A design matrix including covariates with first column of ones to represent the intercept.

delta

A binary vector indicating right censoring.

alpha

The shape parameter \alpha^* of q^*(b).

omega

The scale parameter \omega^* of q^*(b).

mu

Parameter \mu^* of q^*(\beta), a vector of means.

tau

Parameter \tau^* of q^*(\gamma_i), a vector of means.

lambda

The shape parameter \lambda^* of q^*(\sigma^2_\gamma).

eta

The scale parameter \eta^* of q^*(\sigma^2_\gamma).

expectation_b

The expected value of b.

cluster

A numeric vector indicating the cluster assignment for each observation.

Value

Parameter vector \sigma^{2*}_i of q^*(\gamma_i) for all clusters.

See Also

survregVB.frailty.fit


Simulated data incorporating shared frailty effects to model clustered time-to-event data.

Description

Simulated data incorporating shared frailty effects to model clustered time-to-event data.

Usage

simulation_frailty

Format

A dataframe with 75 observations grouped into 15 clusters, each with 5 individuals.

x1

Continuous covariate from N(1, 0.2^2)

x2

Binary covariate from Bernoulli(0.5)

Time

True survival time

Time.15

Observed survival time accounting for uniformly distributed right censoring time from uniform(0,u)

delta

Event indicator for uncensored data (always 1 in this simulation.)

delta.15

Event indicator after censoring (1 = event, 0 = censored).

cluster

Cluster ID (1–15), indicating group-level frailty

. @references Xian, C., Souza, C. P. E. de, He, W., Rodrigues, F. F., & Tian, R. (2024). Fast variational bayesian inference for correlated survival data: An application to invasive mechanical ventilation duration analysis. https://doi.org/10.48550/ARXIV.2408.00177


Simulated data without shared frailty effects to model unclustered time-to-event data.

Description

Simulated data without shared frailty effects to model unclustered time-to-event data.

Usage

simulation_nofrailty

Format

A dataframe with 300 observations.

x1

Continuous covariate from N(1, 0.2^2)

x2

Binary covariate from Bernoulli(0.5)

Time

True survival time

Time.10

Observed survival time accounting for uniformly distributed right censoring time from uniform(0,48)

Time.30

Observed survival time accounting for uniformly distributed right censoring time from uniform(0,17)

delta

Event indicator for uncensored data (always 1 in this simulation.)

delta.10

Event indicator for T.10 (1 = event, 0 = censored).

delta.30

Event indicator for T.30 (1 = event, 0 = censored).

@references Xian, C., Souza, C. P. E. de, He, W., Rodrigues, F. F., & Tian, R. (2024). Variational Bayesian analysis of survival data using a log-logistic accelerated failure time model. Statistics and Computing, 34(2). https://doi.org/10.1007/s11222-023-10365-6


Summary for Variational Bayes log-logistic AFT models.

Description

Produces a summary of a fitted Variational Bayes Parametric Survival Regression Model for a Log-Logistic AFT Model

Usage

## S3 method for class 'survregVB'
summary(object, ci = 0.95, ...)

Arguments

object

The result of a survregVB fit.

ci

The significance level for the credible intervals. (Default:0.95).

...

For future arguments.

Value

An object of class summary.survregVB with components:

If called with shared frailty, the object also contains components:

The estimates component will contain an additional row for the frailty, the estimated variance based on the posterior mean for the random intercepts.

See Also

survregVB


Variational Bayesian Analysis of Survival Data Using a Log-Logistic Accelerated Failure Time Model

Description

Applies a mean-field Variational Bayes (VB) algorithm to infer the parameters of an accelerated failure time (AFT) survival model with right-censored survival times following a log-logistic distribution.

Usage

survregVB(
  formula,
  data,
  alpha_0,
  omega_0,
  mu_0,
  v_0,
  lambda_0,
  eta_0,
  na.action,
  cluster,
  max_iteration = 100,
  threshold = 1e-04
)

Arguments

formula

A formula object, with the response on the left of a ~ operator, and the covariates on the right. The response must be a survival object of type right, as returned by the Surv function.

data

A data.frame in which to interpret the variables named in the formula and cluster arguments.

alpha_0

The shape hyperparameter \alpha_0 of the prior distribution of the scale parameter, b.

omega_0

The shape hyperparameter \omega_0 of the prior distribution of the scale parameter, b.

mu_0

Hyperparameter \mu_0, a vector of means, of the prior distribution of the vector of coefficients, \beta.

v_0

The precision (inverse variance) hyperparameter v_0, of the prior distribution of the vector of coefficients, \beta.

lambda_0

The shape hyperparameter \lambda_0 of the prior distribution of the frailty variance, \sigma_\gamma^2.

eta_0

The scale hyperparameter \eta_0 of the prior distribution of the frailty variance, \sigma_\gamma^2.

na.action

A missing-data filter function, applied to the model.frame, after any subset argument has been used. (Default:options()$na.action).

cluster

An optional variable which clusters the observations to introduce shared frailty for correlated survival data.

max_iteration

The maximum number of iterations for the variational inference optimization. If reached, iteration stops. (Default:100)

threshold

The convergence threshold for the evidence based lower bound (ELBO) optimization. If the difference between the current and previous ELBO's is smaller than this threshold, iteration stops. (Default:0.0001)

Details

The goal of survregVB is to maximize the evidence lower bound (ELBO) to approximate posterior distributions of the AFT model parameters using the VB algorithms with and without shared frailty proposed in Xian et al. (2024) doi:10.1007/s11222-023-10365-6 and doi:10.48550/ARXIV.2408.00177 respectively.

Value

An object of class survregVB.

References

Xian, C., Souza, C. P. E. de, He, W., Rodrigues, F. F., & Tian, R. (2024). "Variational Bayesian analysis of survival data using a log-logistic accelerated failure time model." Statistics and Computing, 34(2). https://doi.org/10.1007/s11222-023-10365-6

Xian, C., Souza, C. P. E. de, He, W., Rodrigues, F. F., & Tian, R. (2024). "Fast variational bayesian inference for correlated survival data: An application to invasive mechanical ventilation duration analysis." https://doi.org/10.48550/ARXIV.2408.00177

See Also

survregVB.object

Examples

# Data frame containing survival data
fit <- survregVB(
  formula = survival::Surv(time, infect) ~ trt + fev,
  data = dnase,
  alpha_0 = 501,
  omega_0 = 500,
  mu_0 = c(4.4, 0.25, 0.04),
  v_0 = 1,
  max_iteration = 100,
  threshold = 0.0005
)
summary(fit)

# Call the survregVB function with shared frailty
fit2 <- survregVB(
  formula = survival::Surv(Time.15, delta.15) ~ x1 + x2,
  data = simulation_frailty,
  alpha_0 = 3,
  omega_0 = 2,
  mu_0 = c(0, 0, 0),
  v_0 = 0.1,
  lambda_0 = 3,
  eta_0 = 2,
  cluster = cluster,
  max_iteration = 100,
  threshold = 0.01
)
summary(fit2)

Variational Bayesian Analysis of Survival Data Using a Log-Logistic Accelerated Failure Time Model

Description

Called by survregVB to do the actual parameter and ELBO computations. This routine does no checking that the arguments are the proper length or type.

Usage

survregVB.fit(
  Y,
  X,
  alpha_0,
  omega_0,
  mu_0,
  v_0,
  max_iteration = 100,
  threshold = 1e-04
)

Arguments

Y

A Surv object containing 2 columns: time and event.

X

A design matrix including covariates with first column of ones to represent the intercept.

alpha_0

The shape hyperparameter \alpha_0 of the prior distribution of the scale parameter, b.

omega_0

The shape hyperparameter \omega_0 of the prior distribution of the scale parameter, b.

mu_0

Hyperparameter \mu_0, a vector of means, of the prior distribution of the vector of coefficients, \beta.

v_0

The precision (inverse variance) hyperparameter v_0, of the prior distribution of the vector of coefficients, \beta.

max_iteration

The maximum number of iterations for the variational inference optimization. If reached, iteration stops. (Default:100)

threshold

The convergence threshold for the evidence based lower bound (ELBO) optimization. If the difference between the current and previous ELBO's is smaller than this threshold, iteration stops. (Default:0.0001)

Details

Implements the Variational Bayes algorithm proposed in the paper "Variational Bayesian analysis of survival data using a log-logistic accelerated failure time model."

For right-censored survival time T_i of the i_{th} subject in a sample, i=1,...,n, the log-logistic AFT model is specified as follows:

\log(T_i)=X_i^T\beta+bz_i, where

Value

A list containing results of the fit.

References

Xian, C., Souza, C. P. E. de, He, W., Rodrigues, F. F., & Tian, R. (2024). "Variational Bayesian analysis of survival data using a log-logistic accelerated failure time model." Statistics and Computing, 34(2). https://doi.org/10.1007/s11222-023-10365-6

See Also

survregVB

Examples

fit <- survregVB.fit(
  Y = survival::Surv(simulation_nofrailty$Time, simulation_nofrailty$delta),
  X = matrix(c(rep(1, 300), simulation_nofrailty$x1, simulation_nofrailty$x2), nrow = 300),
  alpha_0 = 11,
  omega_0 = 10,
  mu_0 = c(0, 0, 0),
  v_0 = 1
)


Variational Bayesian Analysis of Correlated Survival Data Using a Log-Logistic Accelerated Failure Time Model

Description

Called by survregVB to do the actual parameter and ELBO computations for correlated survival data with shared frailty (a random intercept). This routine does no checking that the arguments are the proper length or type.

Usage

survregVB.frailty.fit(
  Y,
  X,
  alpha_0,
  omega_0,
  mu_0,
  v_0,
  lambda_0,
  eta_0,
  cluster,
  max_iteration = 100,
  threshold = 1e-04
)

Arguments

Y

A Surv object containing 2 columns: time and event.

X

A design matrix including covariates with first column of ones to represent the intercept.

alpha_0

The shape hyperparameter \alpha_0 of the prior distribution of the scale parameter, b.

omega_0

The shape hyperparameter \omega_0 of the prior distribution of the scale parameter, b.

mu_0

Hyperparameter \mu_0, a vector of means, of the prior distribution of the vector of coefficients, \beta.

v_0

The precision (inverse variance) hyperparameter v_0, of the prior distribution of the vector of coefficients, \beta.

lambda_0

The shape hyperparameter \lambda_0 of the prior distribution of the frailty variance, \sigma_\gamma^2.

eta_0

The scale hyperparameter \eta_0 of the prior distribution of the frailty variance, \sigma_\gamma^2.

cluster

An optional variable which clusters the observations to introduce shared frailty for correlated survival data.

max_iteration

The maximum number of iterations for the variational inference optimization. If reached, iteration stops. (Default:100)

threshold

The convergence threshold for the evidence based lower bound (ELBO) optimization. If the difference between the current and previous ELBO's is smaller than this threshold, iteration stops. (Default:0.0001)

Details

Implements the Variational Bayes algorithm with random intercepts proposed in the paper "Fast variational bayesian inference for correlated survival data: An application to invasive mechanical ventilation duration analysis".

For right-censored survival time T_{ij} of the j_{th} subject from the i_{th} cluster in the sample, in a sample, i=1,...,K and j=1,...,n_i, the shared-frailty log-logistic AFT model is specified as follows:

\log(T_{ij})=\gamma_i+X_{ij}^T\beta+b\epsilon_{ij}, where

Value

A list containing results of the fit.

References

Xian, C., Souza, C. P. E. de, He, W., Rodrigues, F. F., & Tian, R. (2024). "Fast variational bayesian inference for correlated survival data: An application to invasive mechanical ventilation duration analysis." https://doi.org/10.48550/ARXIV.2408.00177

See Also

survregVB

Examples

fit <- survregVB.frailty.fit(
  X = matrix(c(rep(1, 75), simulation_frailty$x1, simulation_frailty$x2), nrow = 75),
  Y = survival::Surv(simulation_frailty$Time, simulation_frailty$delta),
  alpha_0 = 3,
  omega_0 = 2,
  mu_0 = c(0, 0, 0),
  v_0 = 0.1,
  lambda_0 = 3,
  eta_0 = 2,
  cluster = simulation_frailty$cluster
)


Variational Bayes Accelererated Failure Time Survival Model Object

Description

This class of objects is returned by the survregVB function to represent a fitted parametric log-logistic accelerated failure time (AFT) survival model. Objects of this class have methods for the functions print and summary.

Details

For approximate posterior distributions:

the components of this class are:

If survregVB was called with shared frailty (with the cluster argument), for approximate posterior distributions:

the additional components are present:


Calculates parameter \tau^*_i of q^*(\gamma_i) for i=1,...,K clusters to optimize the evidence based lower bound (ELBO) in survregVB.frailty.fit.

Description

Calculates parameter \tau^*_i of q^*(\gamma_i) for i=1,...,K clusters to optimize the evidence based lower bound (ELBO) in survregVB.frailty.fit.

Usage

tau_star(y, X, delta, alpha, omega, mu, tau, sigma, expectation_b, cluster)

Arguments

y

A vector of observed log-transformed survival times.

X

A design matrix including covariates with first column of ones to represent the intercept.

delta

A binary vector indicating right censoring.

alpha

The shape parameter \alpha^* of q^*(b).

omega

The scale parameter \omega^* of q^*(b).

mu

Parameter \mu^* of q^*(\beta), a vector of means.

tau

Parameter \tau^* of q^*(\gamma_i), a vector of means.

sigma

Parameter \sigma^{2*}_i of q^*(\gamma_i), a vector of variance.

expectation_b

The expected value of b.

cluster

A numeric vector indicating the cluster assignment for each observation.

Value

Parameter vector \tau^*_i of q^*(\gamma_i) for i=1,...,K clusters.

See Also

survregVB.frailty.fit