elicit_mixture: Elicit a mixture prior

View source: R/elicitation.R

elicit_mixtureR Documentation

Elicit a mixture prior

Description

Constructs a finite mixture prior from a list of component bayprior objects (e.g., from elicit_beta, elicit_normal). Mixing weights can be specified or estimated via linear pooling.

Usage

elicit_mixture(components, weights = NULL, label = "Mixture prior")

Arguments

components

List of bayprior objects.

weights

Numeric vector of mixing weights (must sum to 1). If NULL, equal weights are assigned.

label

Character. Label for the mixture prior.

Details

Same-family mixtures (e.g. Beta + Beta, Normal + Normal) have mixture means and SDs computed in closed form. Cross-family mixtures (e.g. Beta + Normal) also have closed-form mixture means and SDs, but the mixture density must be computed numerically by evaluating and summing the component densities on a grid. A warning is issued in this case:

  "Components have different distribution families.
   Mixture densities computed numerically."

This warning is informative, not an error. The numerical approximation is accurate in the body of the distribution but may be less reliable at the tails, particularly for components with very different supports (e.g. a Beta defined on (0, 1) mixed with a Normal defined on (-Inf, Inf)). Use suppressWarnings() only when you have verified the mixture is appropriate for your use case.

Value

A bayprior object with dist = "mixture".

Examples

p1  <- elicit_beta(mean = 0.2, sd = 0.08, method = "moments", expert_id = "E1")
p2  <- elicit_beta(mean = 0.4, sd = 0.10, method = "moments", expert_id = "E2")
mix <- elicit_mixture(list(p1, p2), weights = c(0.5, 0.5),
                       label = "Pooled prior")


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