bayes_gibbs_censored: Bayesian Inference via Gibbs Sampling for Censored Data...

View source: R/bayes_approx.R

bayes_gibbs_censoredR Documentation

Bayesian Inference via Gibbs Sampling for Censored Data Models

Description

Bayesian Inference via Gibbs Sampling for Censored Data Models

Usage

bayes_gibbs_censored(log_posterior, init_par, n_sim = 5000, burn_in = 1000)

Arguments

log_posterior

Function taking parameter vector and returning log posterior density.

init_par

Initial parameter vector.

n_sim

Total number of MCMC iterations.

burn_in

Number of initial iterations to discard as burn-in.

Value

S3 object of class bayes_fit with parameter chains, posterior means, and credible intervals.

Examples

log_post <- function(th) {
  if (th[1] <= 0) return(-Inf)
  dexp(th[1], rate = 1, log = TRUE) +
    sum(dexp(c(0.5, 1.2, 0.8), rate = th[1], log = TRUE))
}
bayes_gibbs_censored(
  log_post, init_par = c(1.0),
  n_sim = 1000, burn_in = 200
)

CompRiskRel documentation built on Aug. 5, 2026, 9:08 a.m.