Package: BayesFBHborrow 2.0.2

Darren Scott

BayesFBHborrow: Bayesian Dynamic Borrowing with Flexible Baseline Hazard Function

Allows Bayesian borrowing from a historical dataset for time-to- event data. A flexible baseline hazard function is achieved via a piecewise exponential likelihood with time varying split points and smoothing prior on the historic baseline hazards. The method is described in Scott and Lewin (2024) <doi:10.48550/arXiv.2401.06082>, and the software paper is in Axillus et al. (2024) <doi:10.48550/arXiv.2408.04327>.

Authors:Darren Scott [aut, cre], Sophia Axillus [aut]

BayesFBHborrow_2.0.2.tar.gz
BayesFBHborrow_2.0.2.tar.gz(r-4.5-noble)BayesFBHborrow_2.0.2.tar.gz(r-4.4-noble)
BayesFBHborrow_2.0.2.tgz(r-4.4-emscripten)BayesFBHborrow_2.0.2.tgz(r-4.3-emscripten)
BayesFBHborrow.pdf |BayesFBHborrow.html
BayesFBHborrow/json (API)

# Install 'BayesFBHborrow' in R:
install.packages('BayesFBHborrow', repos = c('https://cran.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Datasets:
  • piecewise_exp_cc - Example data, simulated from a piecewise exponential model.
  • piecewise_exp_hist - Example data, simulated from a piecewise exponential model.
  • weibull_cc - Example data, simulated from a Weibull distribution.
  • weibull_hist - Example data, simulated from a Weibull distribution

This package does not link to any Github/Gitlab/R-forge repository. No issue tracker or development information is available.

1.60 score 1 scripts 243 downloads 4 exports 36 dependencies

Last updated 2 months agofrom:65eb3ad6cf. Checks:OK: 2. Indexed: yes.

TargetResultDate
Doc / VignettesOKNov 16 2024
R-4.5-linuxOKNov 16 2024

Exports:BayesFBHborrowGibbsMHgroup_summaryinit_lambda_hyperparameters

Dependencies:backportscheckmateclicolorspacedplyrfansifarvergenericsggplot2gluegtableinvgammaisobandlabelinglatticelifecyclemagrittrMASSMatrixmgcvmunsellmvtnormnlmepillarpkgconfigR6RColorBrewerrlangscalessurvivaltibbletidyselectutf8vctrsviridisLitewithr

Readme and manuals

Help Manual

Help pageTopics
Proposal beta with a Metropolis Adjusted Langevin (MALA).beta_MH_MALA
Newton Raphson MH move.beta_MH_NR
Beta Metropolis-Hastings random walk move.beta_MH_RW
Mean for MALA using derivative for beta proposal.beta_mom
First and second derivative of target for mode and variance of proposal.beta_mom.NR.fun
Beta MH RW sampler from freq PEM fit.beta.MH.RW.glm
Birth move in RJMCMC.birth_move
Create data.frame for piecewise exponential models.dataframe_fun
Death move in RJMCMC.death_move
Fit frequentist piecewise exponential model for MLE and information matrix of beta.glmFit
Calculate covariance matrix in the MVN-ICAR.ICAR_calc
Input checker.input_check
RJMCMC (with Bayesian Borrowing).J_RJMCMC
RJMCMC (without Bayesian Borrowing).J_RJMCMC_NoBorrow
Lambda_0 MH step, proposal from conditional conjugate posterior.lambda_0_MH_cp
Lambda_0 MH step, proposal from conditional conjugate posterior.lambda_0_MH_cp_NoBorrow
Propose lambda from a gamma conditional conjugate posterior proposal.lambda_conj_prop
Lambda MH step, proposal from conditional conjugate posterior.lambda_MH_cp
Calculate log gamma ratio for two different parameter values.lgamma_ratio
Loglikelihood ratio calculation for beta parameters.llikelihood_ratio_beta
Log likelihood for lambda / lambda_0 update.llikelihood_ratio_lambda
Log likelihood function.log_likelihood
Computes the logarithmic sum of an exponential.logsumexp
Log density of proposal for MALA.lprop_density_beta
log Gaussian proposal density for Newton Raphson proposal.lprop.dens.beta.NR
Calculate log density tau prior.ltau_dprior
Calculate mu posterior update.mu_update
Normalize a set of probability to one, using the the log-sum-exp trick.normalize_prob
Calculates nu and sigma2 for the Gaussian Markov random field prior, for a given split point j.nu_sigma_update
Plot histogram from MCMC samples.plot_hist
Plot smoothed baseline hazards.plot_matrix
Plot MCMC trace.plot_trace
Predictive hazard from BayesFBHborrow object.predictive_hazard
Predictive hazard ratio (HR) from BayesFBHborrow object.predictive_hazard_ratio
Predictive survival from BayesFBHborrow object.predictive_survival
Set tuning parameters.set_hyperparameters
Set tuning parameters.set_tuning_parameters
Metropolis Hastings step: shuffle the split point locations (with Bayesian borrowing).shuffle_split_point_location
Metropolis Hastings step: shuffle the split point locations (without Bayesian borrowing).shuffle_split_point_location_NoBorrow
Calculate sigma2 posterior update.sigma2_update
Smoothed hazard function.smooth_hazard
Smoothed survival curve.smooth_survival
Sample tau from posterior distribution.tau_update
BayesFBHborrow: Run MCMC for a piecewise exponential modelBayesFBHborrow
Run the MCMC sampler without Bayesian BorrowingBayesFBHborrow.NoBorrow
Run the MCMC sampler with Bayesian BorrowingBayesFBHborrow.WBorrow
Extract mean posterior valuescoef.BayesFBHborrow
S3 generic, calls the correct GibbsMH samplerGibbsMH
GibbsMH sampler, without Bayesian BorrowingGibbsMH.NoBorrow
GibbsMH sampler, with Bayesian BorrowingGibbsMH.WBorrow
Create group level datagroup_summary
Initialize lambda hyperparametersinit_lambda_hyperparameters
Example data, simulated from a piecewise exponential model.piecewise_exp_cc
Example data, simulated from a piecewise exponential model.piecewise_exp_hist
Plot the MCMC resultsplot.BayesFBHborrow
Summarize fixed MCMC resultssummary.BayesFBHborrow
Example data, simulated from a Weibull distribution.weibull_cc
Example data, simulated from a Weibull distributionweibull_hist