Skip to contents

Fit a competing-risks model (the observed maximum of several independent parent distributions) with a Bayesian MCMC analysis. Wraps the shared C++ CompetingRiskAnalysis.

Usage

competing_risk_analysis(
  data,
  families,
  sampler = "DEMCz",
  iterations = 3000L,
  output_length = 10000L,
  credible_level = 0.9,
  seed = 12345L,
  exceedance_probabilities = NULL,
  thinning_interval = -1L
)

Arguments

data

numeric vector of observations.

families

character vector of parent distribution family names (e.g. c("Gumbel", "Weibull")).

sampler

MCMC sampler: "DEMCz" (default), "DEMCzs", "ARWMH", or "NUTS".

iterations

number of post-warmup MCMC iterations.

output_length

number of posterior samples used to build the credible band.

credible_level

credible-interval width (e.g. 0.90 for a 90% band).

seed

PRNG seed for the sampler (fixed for reproducibility).

exceedance_probabilities

optional numeric vector of exceedance probabilities at which to tabulate the curve; when NULL, the 25 standard default ordinates are used.

thinning_interval

MCMC thinning interval; -1 (default) keeps the sampler's own default.

Value

A named list with the same shape as mixture_analysis().

Examples

x <- c(7872, 8624, 5894, 12540, 8307, 6009, 13320, 10641, 8458, 8838, 11742, 9117)
fit <- competing_risk_analysis(x, c("Gumbel", "Weibull"), iterations = 100,
                               output_length = 200, seed = 12345, thinning_interval = 1)
fit$aic
#> [1] 358.1024