Skip to contents

Creates a voi_problem object from a matrix of action-state outcomes and prior/posterior probability vectors. Handles EVPI, EVPXI, and EVSI.

Usage

voi_problem(V, p_prior, p_posterior = NULL, pp = NULL)

Arguments

V

Numeric matrix of dimensions (actions x states). V[a, s] is the outcome of taking action a when the true state is s.

p_prior

Numeric vector of length S (number of states) giving the prior probability of each state. Must sum to 1.

p_posterior

Numeric matrix of dimensions (K x S), where row k gives the posterior probability of each state after the k-th possible experimental outcome. If NULL, assumes EVPI (perfect information): each outcome reveals one state with certainty.

pp

Numeric vector of length K giving the probability of each experimental outcome. If NULL and p_posterior is also NULL, set equal to p_prior (for EVPI). If NULL but p_posterior is given, equal weights are assigned.

Value

An S3 object of class voi_problem.

Examples

# EVPI: 2-action, 2-state chytrid problem (Canessa et al. 2015)
V <- matrix(c(55, 135, 100, 100), nrow = 2, byrow = TRUE)
p <- c(0.5, 0.5)
chytrid <- voi_problem(V, p)
#> ℹ VOI problem: 2 actions, 2 states, 2 experiment outcomes.

# EVSI: with explicit posterior and outcome probabilities
pp <- c(0.395, 0.605)
p_post <- matrix(c(0.92, 0.08, 0.22, 0.78), nrow = 2, byrow = TRUE)
chytrid_si <- voi_problem(V, p, p_post, pp)
#> ℹ VOI problem: 2 actions, 2 states, 2 experiment outcomes.