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 |
alpha |
The shape parameter |
omega |
The scale parameter |
mu |
Parameter |
expectation_b |
The expected value of b. |
Value
Parameter \Sigma^*
of q^*(\beta)
.
See Also
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 |
alpha |
The shape parameter |
omega |
The scale parameter |
mu |
Parameter |
tau |
Parameter |
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
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 |
delta |
A binary vector indicating right censoring. |
Value
Parameter \alpha^*
of q^*(b)
.
See Also
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 |
omega_0 |
The shape hyperparameter |
mu_0 |
Hyperparameter |
v_0 |
The precision (inverse variance) hyperparameter |
alpha |
The shape parameter |
omega |
The scale parameter |
mu |
Parameter |
Sigma |
Parameter |
expectation_b |
The expected value of b. |
See Also
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 |
omega_0 |
The shape hyperparameter |
mu_0 |
Hyperparameter |
v_0 |
The precision (inverse variance) hyperparameter |
lambda_0 |
The shape hyperparameter |
eta_0 |
The scale hyperparameter |
alpha |
The shape parameter |
omega |
The scale parameter |
mu |
Parameter |
Sigma |
Parameter |
tau |
Parameter |
sigma |
Parameter |
lambda |
The shape parameter |
eta |
The scale parameter |
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
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 |
tau |
Parameter |
sigma |
Parameter |
Value
Parameter \eta^*
of q^*(\sigma^2_{\gamma})
.
See Also
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 |
K |
The number of clusters. |
Value
Parameter \lambda^*
of q^*(\sigma^2_{\gamma})
.
See Also
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 |
v_0 |
The precision (inverse variance) hyperparameter |
alpha |
The shape parameter |
omega |
The scale parameter |
mu |
Parameter |
Sigma |
Parameter |
expectation_b |
The expected value of b. |
Value
Parameter \mu^*
of q^*(\beta)
.
See Also
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 |
v_0 |
The precision (inverse variance) hyperparameter |
alpha |
The shape parameter |
omega |
The scale parameter |
mu |
Parameter |
Sigma |
Parameter |
tau |
Parameter |
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
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 |
mu |
Parameter |
expectation_b |
The expected value of b. |
Value
Parameter \omega^*
of q^*(b)
.
See Also
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 |
mu |
Parameter |
tau |
Parameter |
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
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 |
omega |
The scale parameter |
mu |
Parameter |
tau |
Parameter |
lambda |
The shape parameter |
eta |
The scale parameter |
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
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 |
ci |
The significance level for the credible intervals. (Default:0.95). |
... |
For future arguments. |
Value
An object of class summary.survregVB
with components:
-
ELBO
: The final value of the Evidence Lower Bound (ELBO) at the last iteration. -
alpha
: The shape parameter\alpha^*
ofq^*(b)
. -
omega
: The scale parameter\omega^*
ofq^*(b)
. -
mu
: Parameter\mu^*
ofq^*(\beta)
, a vector of means. -
Sigma
: Parameter\Sigma^*
ofq^*(\beta)
, a covariance matrix. -
na.action
: A missing-data filter function, applied to themodel.frame
, after any subset argument has been used. -
iterations
: The number of iterations performed by the VB algorithm: before converging or reachingmax_iteration
. -
n
: The number of observations. -
call
: The function call used to invoke thesurvregVB
method. -
not_converged
: A boolean indicating if the algorithm converged.-
TRUE
: If the algorithm did not converge prior to achievingmax_iteration
. -
NULL
: If the algorithm converged successfully.
-
-
estimates
: A matrix with one row for each regression coefficient, and one row for the scale parameter. The columns contain:-
Value
: The estimated value based on the posterior distribution mean. -
Lower CI
: The lower bound of the credible interval. -
Upper CI
: The upper bound of the credible interval.
-
If called with shared frailty, the object also contains components:
-
lambda
: The shape parameter\lambda^*
ofq^*(\sigma^2_\gamma)
. -
eta
: The scale parameter\eta^*
ofq^*(\sigma^2_\gamma)
. -
tau
: Parameter\tau^*_i
ofq^*(\gamma_i)
, a vector of means. -
sigma
: Parameter\sigma^{2*}_i
ofq^*(\gamma_i)
, a vector of variance.
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
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 |
data |
A |
alpha_0 |
The shape hyperparameter |
omega_0 |
The shape hyperparameter |
mu_0 |
Hyperparameter |
v_0 |
The precision (inverse variance) hyperparameter |
lambda_0 |
The shape hyperparameter |
eta_0 |
The scale hyperparameter |
na.action |
A missing-data filter function, applied to the
|
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
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 |
X |
A design matrix including covariates with first column of ones to represent the intercept. |
alpha_0 |
The shape hyperparameter |
omega_0 |
The shape hyperparameter |
mu_0 |
Hyperparameter |
v_0 |
The precision (inverse variance) hyperparameter |
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
-
X_i
is a column vector of lengthp, p\ge2
containingp-1
covariates and a constant one to incorporate the intercept (i.e.,X_i=(1,x_{i1},...,x_{i(p-1)})^T
), -
\beta
is the corresponding vector of coefficients for the fixed effects, -
z_i
is a random variable following a standard logistic distribution, and -
b is a scale parameter.
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
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 |
X |
A design matrix including covariates with first column of ones to represent the intercept. |
alpha_0 |
The shape hyperparameter |
omega_0 |
The shape hyperparameter |
mu_0 |
Hyperparameter |
v_0 |
The precision (inverse variance) hyperparameter |
lambda_0 |
The shape hyperparameter |
eta_0 |
The scale hyperparameter |
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
-
X_{ij}
is a column vector of lengthp, p\ge2
containingp-1
covariates and a constant one to incorporate the intercept (i.e.,X_i=(1,x_{ij1},...,x_{ij(p-1)})^T
), -
\beta
is the corresponding vector of coefficients for the fixed effects, -
\gamma_i
is a random intercept for thei_{th}
cluster, -
\epsilon_{ij}
is a random variable following a standard logistic distribution, and -
b is a scale parameter.
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
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:
-
q^*(\beta)
, aN_p(\mu^*,\Sigma^*)
density function, and -
q^*(b)
, an\text{Inverse-Gamma}(\alpha^*,\omega^*)
density function,
the components of this class are:
-
ELBO
: The final value of the Evidence Lower Bound (ELBO) at the last iteration. -
alpha
: The shape parameter\alpha^*
ofq^*(b)
. -
omega
: The scale parameter\omega^*
ofq^*(b)
. -
mu
: Parameter\mu^*
ofq^*(\beta)
, a vector of means. -
Sigma
: Parameter\Sigma^*
ofq^*(\beta)
, a covariance matrix. -
na.action
: A missing-data filter function, applied to themodel.frame
, after any subset argument has been used. -
iterations
: The number of iterations performed by the VB algorithm: before converging or reachingmax_iteration
. -
n
: The number of observations. -
call
: The function call used to invoke thesurvregVB
method. -
not_converged
: A boolean indicating if the algorithm converged.-
TRUE
: If the algorithm did not converge prior to achievingmax_iteration
. -
NULL
: If the algorithm converged successfully.
-
If survregVB
was called with shared frailty (with the cluster
argument), for approximate posterior distributions:
-
q^*(\sigma^2_\gamma)
, an\text{Inverse-Gamma}(\lambda^*,\eta^*)
density function, -
q^*(\gamma_i)
, aN(\tau^*_i,\sigma^{2*}_i)
density function, fori=1,...,K
clusters, and
the additional components are present:
-
lambda
: The shape parameter\lambda^*
ofq^*(\sigma^2_\gamma)
. -
eta
: The scale parameter\eta^*
ofq^*(\sigma^2_\gamma)
. -
tau
: Parameter\tau^*_i
ofq^*(\gamma_i)
, a vector of means. -
sigma
: Parameter\sigma^{2*}_i
ofq^*(\gamma_i)
, a vector of variance.
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 |
omega |
The scale parameter |
mu |
Parameter |
tau |
Parameter |
sigma |
Parameter |
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.