Compute VOI across a range of risk aversion parameter values
Source:R/sensitivity.R
voi_sensitivity.RdSweeps 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.
Arguments
- voi
A
voi_problemobject (aftervoi_problem()but before any pipe steps — the function reruns the full pipeline internally).- rp
A
risk_preferenceobject. 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 fromrp(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 toEV_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).
NAif no posterior is available.- is_posterior_mean
Logical.
TRUEfor 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