| elicit_beta | R Documentation |
Fits a Beta(alpha, beta) distribution to expert-specified quantiles or moments. Implements the structured elicitation framework of the SHELF methodology, supporting the documented, reproducible prior derivation called for in the FDA's 2026 draft guidance on Bayesian methods.
elicit_beta(
quantiles = NULL,
mean = NULL,
sd = NULL,
method = c("quantile", "moments"),
expert_id = "Expert_1",
label = "Unknown quantity",
tol = 1e-06
)
quantiles |
Named numeric vector of quantile specifications, e.g.
|
mean |
Optional numeric. Expert-specified mean for moment matching. |
sd |
Optional numeric. Expert-specified SD for moment matching. |
method |
Character. One of |
expert_id |
Character. Identifier for this expert's elicitation. |
label |
Character. Description of the quantity being elicited. |
tol |
Numeric. Optimisation tolerance. Default |
For method = "moments", the mean and SD are matched analytically
to the Beta family using the standard method-of-moments identities:
\alpha = \bar{x}\left(\frac{\bar{x}(1-\bar{x})}{s^2} - 1\right),
\quad
\beta = (1-\bar{x})\left(\frac{\bar{x}(1-\bar{x})}{s^2} - 1\right)
where \bar{x} is mean and s is sd. This requires
s^2 < \bar{x}(1-\bar{x}); an SD too large for the given mean implies
a negative \alpha or \beta and raises an error. For
method = "quantile", \alpha and \beta are instead found
numerically by minimising squared error between the fitted quantiles and
the expert-specified quantiles.
An object of class bayprior with components:
dist"beta"
paramsNamed list with alpha and beta
methodElicitation method used
expert_idExpert identifier
labelQuantity label
fit_summarySummary statistics of fitted prior
# Expert believes response rate is ~30%, with 90% CI of [10%, 60%]
prior <- elicit_beta(
quantiles = c("0.05" = 0.10, "0.50" = 0.30, "0.95" = 0.60),
expert_id = "Expert_1",
label = "Response rate (treatment arm)"
)
print(prior)
plot(prior)
# Moment-based elicitation
prior_mom <- elicit_beta(
mean = 0.30, sd = 0.12,
method = "moments",
label = "Response rate"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.