View source: R/compute-assurance.R
| assurance_prior_weights | R Documentation |
A convenience wrapper that evaluates a parametric prior distribution at
each value in effects, normalises the densities to sum to 1, and returns
a named numeric vector that can be passed directly to compute_assurance()
as prior_weights.
assurance_prior_weights(effects, dist = c("normal", "uniform", "beta"), ...)
effects |
Numeric vector of effect-grid values (the same vector
passed to |
dist |
Character string naming the distribution. One of
|
... |
Named distribution parameters forwarded to the internal
density calculator. See |
The output format is identical to that of beta_weights_on_grid(), which
can also be used directly when a beta prior is appropriate.
Named numeric vector of normalised weights (sums to 1), with
names equal to as.character(effects).
effects <- c(0.1, 0.3, 0.5, 0.7, 0.9)
# Normal prior centred on 0.5
assurance_prior_weights(effects, dist = "normal", mean = 0.5, sd = 0.2)
# Uniform prior (equal weight)
assurance_prior_weights(effects, dist = "uniform")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.