elicit_gamma: Elicit a Gamma prior via quantile matching or moment matching

View source: R/elicitation.R

elicit_gammaR Documentation

Elicit a Gamma prior via quantile matching or moment matching

Description

Elicit a Gamma prior via quantile matching or moment matching

Usage

elicit_gamma(
  quantiles = NULL,
  mean = NULL,
  sd = NULL,
  method = c("quantile", "moments"),
  expert_id = "Expert_1",
  label = "Unknown quantity",
  tol = 1e-06
)

Arguments

quantiles

Named numeric vector of quantiles. Values must be positive.

mean

Optional numeric. Expert mean.

sd

Optional numeric. Expert SD.

method

Character. "quantile" or "moments".

expert_id

Character. Expert identifier.

label

Character. Quantity description.

tol

Numeric. Optimisation tolerance.

Details

For method = "moments", mean and SD are matched to the Gamma's shape-rate parameterisation via

\text{shape} = \left(\frac{\bar{x}}{s}\right)^2, \quad \text{rate} = \frac{\bar{x}}{s^2}

Value

An object of class bayprior.

Examples

prior <- elicit_gamma(
  mean   = 5, sd = 2,
  method = "moments",
  label  = "Median OS (months)"
)


bayprior documentation built on Aug. 27, 2026, 1:09 a.m.