Learn R Programming

BayesFBHborrow (version 2.0.2)

Bayesian Dynamic Borrowing with Flexible Baseline Hazard Function

Description

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) , and the software paper is in Axillus et al. (2024) .

Copy Link

Version

Install

install.packages('BayesFBHborrow')

Monthly Downloads

198

Version

2.0.2

License

Apache License (>= 2)

Maintainer

Darren Scott

Last Published

September 16th, 2024

Functions in BayesFBHborrow (2.0.2)

GibbsMH.NoBorrow

GibbsMH sampler, without Bayesian Borrowing
GibbsMH.WBorrow

GibbsMH sampler, with Bayesian Borrowing
BayesFBHborrow

BayesFBHborrow: Run MCMC for a piecewise exponential model
.J_RJMCMC_NoBorrow

RJMCMC (without Bayesian Borrowing)
BayesFBHborrow.WBorrow

Run the MCMC sampler with Bayesian Borrowing
.J_RJMCMC

RJMCMC (with Bayesian Borrowing)
.ICAR_calc

Calculate covariance matrix in the MVN-ICAR
GibbsMH

S3 generic, calls the correct GibbsMH sampler
coef.BayesFBHborrow

Extract mean posterior values
BayesFBHborrow.NoBorrow

Run the MCMC sampler without Bayesian Borrowing
.beta_MH_MALA

Proposal beta with a Metropolis Adjusted Langevin (MALA)
.beta_MH_RW

Beta Metropolis-Hastings random walk move
.beta_MH_NR

Newton Raphson MH move
.dataframe_fun

Create data.frame for piecewise exponential models
.ltau_dprior

Calculate log density tau prior
.lambda_0_MH_cp

Lambda_0 MH step, proposal from conditional conjugate posterior
.beta_mom

Mean for MALA using derivative for beta proposal
.beta_mom.NR.fun

First and second derivative of target for mode and variance of proposal
.beta.MH.RW.glm

Beta MH RW sampler from freq PEM fit
.birth_move

Birth move in RJMCMC
.input_check

Input checker
.mu_update

Calculate mu posterior update
.lprop.dens.beta.NR

log Gaussian proposal density for Newton Raphson proposal
.lgamma_ratio

Calculate log gamma ratio for two different parameter values
.lprop_density_beta

Log density of proposal for MALA
.llikelihood_ratio_lambda

Log likelihood for lambda / lambda_0 update
.shuffle_split_point_location

Metropolis Hastings step: shuffle the split point locations (with Bayesian borrowing)
.lambda_conj_prop

Propose lambda from a gamma conditional conjugate posterior proposal
.llikelihood_ratio_beta

Loglikelihood ratio calculation for beta parameters
.log_likelihood

Log likelihood function
.plot_hist

Plot histogram from MCMC samples
.nu_sigma_update

Calculates nu and sigma2 for the Gaussian Markov random field prior, for a given split point j
.death_move

Death move in RJMCMC
.logsumexp

Computes the logarithmic sum of an exponential
.normalize_prob

Normalize a set of probability to one, using the the log-sum-exp trick
.plot_matrix

Plot smoothed baseline hazards
.predictive_survival

Predictive survival from BayesFBHborrow object
.set_tuning_parameters

Set tuning parameters
summary.BayesFBHborrow

Summarize fixed MCMC results
piecewise_exp_cc

Example data, simulated from a piecewise exponential model.
.set_hyperparameters

Set tuning parameters
.smooth_hazard

Smoothed hazard function
.predictive_hazard_ratio

Predictive hazard ratio (HR) from BayesFBHborrow object
.sigma2_update

Calculate sigma2 posterior update
plot.BayesFBHborrow

Plot the MCMC results
.shuffle_split_point_location_NoBorrow

Metropolis Hastings step: shuffle the split point locations (without Bayesian borrowing)
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
.glmFit

Fit frequentist piecewise exponential model for MLE and information matrix of beta
.lambda_0_MH_cp_NoBorrow

Lambda_0 MH step, proposal from conditional conjugate posterior
.lambda_MH_cp

Lambda MH step, proposal from conditional conjugate posterior
group_summary

Create group level data
init_lambda_hyperparameters

Initialize lambda hyperparameters
.plot_trace

Plot MCMC trace
.predictive_hazard

Predictive hazard from BayesFBHborrow object
.smooth_survival

Smoothed survival curve
.tau_update

Sample tau from posterior distribution