Skip to contents

A convenience wrapper for the Expected Value of Sample Information (EVSI) — the most you would pay for a specific survey whose possible outcomes and resulting belief updates are already known.

Usage

calculate_evsi(V, p_prior, p_posterior, pp, rp = NULL, outcome_name = "units")

Arguments

V

Numeric matrix (actions x states).

p_prior

Numeric vector of prior state probabilities.

p_posterior

Numeric matrix (experiment outcomes x states). Row k gives posterior state probabilities after observing outcome k.

pp

Numeric vector giving the probability of each survey outcome (same length as nrow(p_posterior)).

rp

Optional risk_preference object.

outcome_name

Character label for the outcome units.

Value

A voi_problem object (invisibly).

Examples

V       <- matrix(c(55, 135, 100, 100), nrow = 2, byrow = TRUE)
p       <- c(0.5, 0.5)
pp      <- c(0.395, 0.605)
p_post  <- matrix(c(0.92, 0.08, 0.22, 0.78), nrow = 2, byrow = TRUE)
calculate_evsi(V, p, p_post, pp, outcome_name = "frogs")
#> ℹ VOI problem: 2 actions, 2 states, 2 experiment outcomes.
#> 
#> ── EVSI Summary ──
#> 
#> ── Decision table ──
#> 
#>    action state_1 state_2 EV_prior best_action?
#>  action_1      55     135       95             
#>  action_2     100     100      100          YES
#> ────────────────────────────────────────────────────────────────────────────────
#> ℹ Best action without survey: action_2
#> ℹ Expected outcome without survey: 100 frogs
#> ℹ Expected outcome with perfect information: 110.527 frogs
#> ✔ EVSI = 10.527 frogs
#> ────────────────────────────────────────────────────────────────────────────────