Learn R Programming

powerbrmsINLA (version 1.3.0)

.compute_weights_from_dist: Compute weights from a parametric prior distribution over an effect grid

Description

Evaluates a named distribution at each value in effect_values, normalises the result to sum to 1, and returns a named numeric vector compatible with compute_assurance() and beta_weights_on_grid().

Usage

.compute_weights_from_dist(dist_spec, effect_values)

Value

Named numeric vector of normalised weights (sums to 1).

Arguments

dist_spec

A list with at minimum a $dist element naming the distribution. Remaining elements are distribution parameters:

  • "normal"mean, sd

  • "uniform"min, max (defaults: range of effect_values)

  • "beta" — either shape1, shape2 or mode, n (concentration; must be > 2). Effects are rescaled to \([0, 1]\) automatically when outside that interval.

effect_values

Numeric vector of effect-grid values at which to evaluate the density.