Skip to contents

Sweeps the risk parameter (gamma for CRRA, alpha for CARA) over a grid and recomputes VOI at each value. Use this to understand how sensitive the VOI is to uncertainty in the elicited risk preference.

Usage

voi_sensitivity(voi, rp, param_grid = NULL, summarize_func = EV_voi)

Arguments

voi

A voi_problem object (after voi_problem() but before any pipe steps — the function reruns the full pipeline internally).

rp

A risk_preference object. Provides the utility model, outcome range, and — if elicited — the posterior grid used as the sweep range.

param_grid

Optional numeric vector of parameter values to sweep. If NULL, uses the posterior grid from rp (if available) or a default range of 100 evenly-spaced values spanning the CRRA/CARA default range.

summarize_func

Summary function passed to summarize_utility(). Defaults to EV_voi (expected utility). Other options: min_voi, ES_voi.

Value

A data frame with columns:

param

Risk aversion parameter value.

voi

Value of Information at that parameter value (in original outcome units, i.e. certainty equivalent difference).

posterior_weight

Posterior probability weight for each parameter value (from elicitation). NA if no posterior is available.

is_posterior_mean

Logical. TRUE for the grid point closest to the posterior mean.

Examples

V  <- matrix(c(55, 135, 100, 100), nrow = 2, byrow = TRUE)
p  <- c(0.5, 0.5)
rp <- risk_preference("CRRA", param = 1, val_min = 0, val_max = 200,
                      outcome_name = "frogs", maximize = TRUE)
problem <- voi_problem(V, p)
#> ℹ VOI problem: 2 actions, 2 states, 2 experiment outcomes.
sens <- voi_sensitivity(problem, rp)
head(sens)
#>       param      voi posterior_weight is_posterior_mean
#> 1 -2.000000 10.53833               NA             FALSE
#> 2 -1.939394 10.80409               NA             FALSE
#> 3 -1.878788 11.07586               NA             FALSE
#> 4 -1.818182 11.35369               NA             FALSE
#> 5 -1.757576 11.63766               NA             FALSE
#> 6 -1.696970 11.92781               NA             FALSE