assurance_prior_weights: Create prior weights over an effect grid for use with...

View source: R/compute-assurance.R

assurance_prior_weightsR Documentation

Create prior weights over an effect grid for use with compute_assurance()

Description

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.

Usage

assurance_prior_weights(effects, dist = c("normal", "uniform", "beta"), ...)

Arguments

effects

Numeric vector of effect-grid values (the same vector passed to brms_inla_power() as effect_grid).

dist

Character string naming the distribution. One of "normal", "uniform", or "beta".

...

Named distribution parameters forwarded to the internal density calculator. See compute_assurance() ⁠@details⁠ for the full list per distribution.

Details

The output format is identical to that of beta_weights_on_grid(), which can also be used directly when a beta prior is appropriate.

Value

Named numeric vector of normalised weights (sums to 1), with names equal to as.character(effects).

Examples

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")

powerbrmsINLA documentation built on July 2, 2026, 5:07 p.m.