Bayesian Mixture Log-Normal Survival Model

Bayesian Survival models via the mixture of Log-Normal distribution extends the well-known survival models and accommodates different behaviour over time and considers higher censored survival times. The proposal combines mixture distributions Fruhwirth-Schnatter(2006) , and data augmentation techniques Tanner and Wong (1987) .


lnmixsurv

Lifecycle:stable R-CMD-check codecov

The lnmixsurv package provides an easy interface to the Bayesian lognormal mixture model proposed by Lobo, Fonseca and Alves, 2023.

An usual formula-type model is implemented in survival_ln_mixture, with the usual suvival::Surv() interface. The model tries to follow the conventions for R modeling packages, and uses the hardhat structure.

The underlying algorithm implementation is a Gibbs sampler which takes initial values from a small run of the EM-Algorithm, with initial values selection based on the log-likelihood. Besides the Bayesian approach, the Expectation-Maximization approach (which focus on maximizing the likelihood) for censored data is also available. The methods are implemented in C++ using RcppArmadillo for the linear algebra operations, RcppGSL for the random number generation and seed control and RcppParallel (since version 3.0.0) for parallelization.

Dependencies

The only dependency is on GSL, so, make sure you have GSL installed before proceeding Below, there are some basic guides on how to install these for each operational system other than Windows (Windows users are probably fine and ready to go).

Mac OS

Run brew install gsl at the console/terminal should be enough for installing GSL.

Linux

The installation of GSL on Linux is distro-specific. For the main distros out-there:

  • Arch: sudo pacman -S gsl
  • CentOS/RHEL: sudo yum install gsl-devel or sudo dnf install gsl-devel (make sure the EPEL – Extra Packages for Enterprise Linux – repository is enabled)
  • Debian/Ubuntu: sudo apt-get install libgsl-dev
  • Fedora: sudo dnf install gsl-devel
  • Gentoo: sudo emerge sci-libs/gsl
  • openSUSE: sudo zypper install gsl-devel

Installation

You can install the latest development version of lnmixsurv from GitHub:

# install.packages("devtools")
devtools::install_github("vivianalobo/lnmixsurv")

Alternatively, to install the latest development version of lnmixsurv, you can use the following code:

# install.packages("devtools")
devtools::install_github("vivianalobo/lnmixsurv", "devel")

parsnip and censored extension

An extension to the models defined by parsnip and censored is also provided, adding the survival_ln_mixture engine to the parsnip::survival_reg() model.

The following models, engines, and prediction type are available/extended through persistencia:

model engine time survival linear_pred raw quantile hazard
survival_reg survival_ln_mixture ✖ ✔ ✖ ✖ ✖ ✔
survival_reg survival_ln_mixture_em ✖ ✔ ✖ ✖ ✖ ✔

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("lnmixsurv")

3.1.7 by Viviana das Graças Ribeiro Lobo, 4 months ago


https://vivianalobo.github.io/lnmixsurv/


Browse source code at https://github.com/cran/lnmixsurv


Authors: Viviana das Graças Ribeiro Lobo [cre] , Thaís Cristina Oliveira da Fonseca [aut] , Mariane Branco Alves [aut] , Vitor Capdeville [aut] , Victor Hugo Soares Ney [aut]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports stats, posterior, hardhat, rlang, generics, dplyr, tidyr, tibble, Rcpp, RcppParallel, tidyselect, broom

Depends on parsnip, survival, ggplot2

Suggests ggsurvfit, plotly, bayesplot, censored, readr, purrr, knitr, rmarkdown, tidymodels, testthat, covr, withr, pec

Linking to Rcpp, RcppArmadillo, RcppGSL, RcppParallel

System requirements: GNU, GNU make, GSL


See at CRAN