Docs/Prior Elicitation

Prior Elicitation for Bayesian Trials

Technical documentation for constructing interpretable Beta priors from expert knowledge, historical data, or quantile specifications. This module is the foundation for all other Bayesian trial design calculators in Zetyra.

1. Overview & Use Cases

The Prior Elicitation module transforms qualitative clinical knowledge into quantitative Beta distribution parameters. This is the critical first step in Bayesian trial design, as the prior directly impacts sample size requirements and operating characteristics.

Why Beta Distributions?

For binary endpoints (response rates, success proportions), the Beta distribution is the conjugate prior to the Binomial likelihood:

θBeta(α,β)θk,nBeta(α+k,β+nk)\theta \sim \text{Beta}(\alpha, \beta) \quad \Rightarrow \quad \theta | k, n \sim \text{Beta}(\alpha + k, \beta + n - k)

This conjugacy enables closed-form posterior updates, fast computation, and exact credible intervals without MCMC sampling.

Mean

μ=αα+β\mu = \frac{\alpha}{\alpha + \beta}

Variance

σ2=μ(1μ)neff+1\sigma^2 = \frac{\mu(1{-}\mu)}{n_{eff}{+}1}

ESS

neff=α+βn_{eff} = \alpha + \beta

Key Insight: Effective Sample Size (ESS)

The sum α+β\alpha + \beta represents the prior's “effective sample size”—how much weight the prior carries relative to observed data. A prior with ESS = 20 has the same influence as 20 observations.

2. Elicitation Methods

Zetyra supports three complementary methods for specifying a Beta prior:

MethodInput RequirementsBest ForRegulatory Strength
Quantile MatchingMedian + credible interval boundsExpert opinion elicitationMedium
ESS-BasedTarget mean + desired ESSControlling prior influenceMedium
Historical DataEvents/total from prior study + discountPublished Phase II dataStrong

3. Quantile Matching

Quantile matching finds Beta parameters that satisfy specified quantile constraints. This is the most natural way to translate expert beliefs into a prior distribution.

Algorithm

Given a median mm and a credible interval[L,U][L, U] at confidence level 1γ1 - \gamma, we solve:

minα,β[FBeta1(0.5;α,β)m]2+[FBeta1(γ/2;α,β)L]2+[FBeta1(1γ/2;α,β)U]2\min_{\alpha, \beta} \left[ F_{\text{Beta}}^{-1}(0.5; \alpha, \beta) - m \right]^2 + \left[ F_{\text{Beta}}^{-1}(\gamma/2; \alpha, \beta) - L \right]^2 + \left[ F_{\text{Beta}}^{-1}(1-\gamma/2; \alpha, \beta) - U \right]^2

Example

An oncologist believes the response rate is around 12%, and is 90% confident it lies between 5% and 20%.

Input

  • Median: 0.12
  • Lower bound (5%): 0.05
  • Upper bound (95%): 0.20
  • Confidence: 90%

Output

  • α6.0\alpha \approx 6.0
  • β44.0\beta \approx 44.0
  • ESS = 50
  • Mean = 12%

Validation Check

Always verify the fitted distribution by checking that the actual quantiles of the resulting Beta match your specifications. The calculator displays the achieved coverage to confirm fit quality.

4. ESS-Based Prior

The ESS-based method allows direct control over prior influence. This is useful when you want to specify “the prior should count as N pseudo-observations.”

Formula

Given a target mean μ\mu and effective sample size neffn_{eff}:

α=μneff,β=(1μ)neff\alpha = \mu \cdot n_{eff}, \quad \beta = (1 - \mu) \cdot n_{eff}

Weakly Informative

ESS = 2–10: Minimal prior influence, data-dominated inference

Example: Beta(1.2,8.8)\text{Beta}(1.2, 8.8) for μ=0.12\mu = 0.12, ESS = 10

Moderately Informative

ESS = 20–50: Balanced prior/data contribution

Example: Beta(6,44)\text{Beta}(6, 44) for μ=0.12\mu = 0.12, ESS = 50

Rule of Thumb

For a trial planning to enroll nn patients, a prior ESS of n/10n/10 to n/5n/5typically provides meaningful information without dominating the data.

5. Historical Data Prior

When prior data is available (e.g., Phase II results, published studies), the historical data method converts observed counts directly into Beta parameters with optional discounting.

Power Prior Formula

Given historical data with kk events out ofnn patients, and discount factor δ[0,1]\delta \in [0, 1]:

α=1+δk,β=1+δ(nk)\alpha = 1 + \delta \cdot k, \quad \beta = 1 + \delta \cdot (n - k)
Discount FactorInterpretationWhen to Use
δ=1.0\delta = 1.0Full borrowingSame population, same treatment
δ=0.5\delta = 0.5Skeptical borrowingSimilar but not identical population
δ=0.2\delta = 0.2Conservative borrowingDifferent indication, mechanism-based prior
δ=0.0\delta = 0.0No borrowing (uninformative)Historical data not relevant

Example: Phase II to Phase III

A Phase II trial observed 24 responders out of 200 patients (12% response rate).

Full Borrowing (δ=1\delta=1)

Beta(25,177)\text{Beta}(25, 177)

ESS = 202

Skeptical (δ=0.5\delta=0.5)

Beta(13,89)\text{Beta}(13, 89)

ESS = 102

Conservative (δ=0.2\delta=0.2)

Beta(5.8,36.2)\text{Beta}(5.8, 36.2)

ESS = 42

6. Predictive Distributions

The prior predictive distribution shows what outcomes the prior expects before seeing data. This is essential for validating prior plausibility.

Beta-Binomial Predictive

If θBeta(α,β)\theta \sim \text{Beta}(\alpha, \beta) andXθBinomial(n,θ)X | \theta \sim \text{Binomial}(n, \theta), then the marginal distribution is:

P(X=k)=(nk)B(α+k,β+nk)B(α,β)P(X = k) = \binom{n}{k} \frac{B(\alpha + k, \beta + n - k)}{B(\alpha, \beta)}

Where B(,)B(\cdot, \cdot) is the Beta function.

Prior Predictive Check

The calculator displays the prior predictive distribution for a future trial. Use this to verify: “Does the range of predicted outcomes match clinical expectations?” If the prior predicts implausible outcomes (e.g., 50% response rate when 15% is expected), revise the prior.

7. Integration Workflow

Prior Elicitation is designed to feed directly into other Bayesian calculators. The workflow is:

1

Elicit Prior

Use this calculator

2

Transfer

Click “Use in Sample Size”

3

Size Trial

Get N with operating characteristics

4

Document

Export SAP-ready justification

Connected Calculators

8. Regulatory Considerations

FDA Bayesian Guidance (January 2026)

Section V.D requires sponsors to provide “clear justification for the choice of prior distribution” including the source of information, any discounting applied, and sensitivity analyses.

Documentation Requirements

  • Source of Information: Specify whether prior is based on historical data, expert opinion, meta-analysis, or other sources.
  • Prior Parameters: Report exact α,β\alpha, \betavalues with corresponding mean, variance, and ESS.
  • Discounting Rationale: If using historical data, justify the discount factor choice.
  • Sensitivity Analysis: Show results under alternative priors (e.g., uninformative, skeptical, enthusiastic).

9. API Quick Reference

POST /api/v1/calculators/prior-elicitation

Key Parameters

ParameterTypeDescription
methodstring"quantile_matching" | "ess_based" | "historical" (required)
median, lower_bound, upper_boundfloatFor quantile_matching method
prior_mean, essfloat, intFor ess_based method
n_events, n_totalintFor historical method

Key Response Fields

  • prior_parameters.alpha/beta — Beta distribution parameters
  • summary.mean, summary.ess — Prior mean and effective sample size
  • pdf_data, cdf_data — Plot data for visualization
  • prior_predictive — Predictive distribution statistics
View full API documentation →