| elicit_mixture | R Documentation |
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.
elicit_mixture(components, weights = NULL, label = "Mixture prior")
components |
List of |
weights |
Numeric vector of mixing weights (must sum to 1). If
|
label |
Character. Label for the mixture prior. |
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.
A bayprior object with dist = "mixture".
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.