elicit_lognormal: Elicit a Log-Normal prior via quantile matching or moment...

View source: R/elicitation.R

elicit_lognormalR Documentation

Elicit a Log-Normal prior via quantile matching or moment matching

Description

Fits a Log-Normal distribution to expert-specified quantiles or moments. Appropriate for positive-valued quantities such as hazard ratios, fold changes, median survival times, or PK parameters.

Usage

elicit_lognormal(
  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. Values must be strictly positive. E.g. c("0.05" = 0.5, "0.50" = 2.0, "0.95" = 8.0).

mean

Optional numeric. Expert mean on the original scale.

sd

Optional numeric. Expert SD on the original scale.

method

Character. "quantile" (default) or "moments".

expert_id

Character. Expert identifier.

label

Character. Quantity description.

tol

Numeric. Optimisation tolerance.

Details

For method = "moments", the mean and SD (on the original, untransformed scale) are matched to the Log-Normal's own meanlog/sdlog parameterisation via

\text{sdlog} = \sqrt{\log\left(1 + \frac{s^2}{\bar{x}^2}\right)}, \quad \text{meanlog} = \log(\bar{x}) - \frac{\text{sdlog}^2}{2}

Value

An object of class bayprior with dist = "lognormal".

Examples

prior <- elicit_lognormal(
  quantiles = c("0.05" = 0.40, "0.50" = 0.70, "0.95" = 1.20),
  label     = "Hazard ratio (treatment vs control)"
)
print(prior)


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