Skip to contents

Returns a data frame showing the outcome of each action in each state, the expected value under the prior, and which action is optimal before and after resolving uncertainty. Useful for presenting results to stakeholders.

Usage

decision_table(voi)

Arguments

voi

A voi_problem object. Works at any stage in the pipe; the richer the object (e.g. after optimize_action()), the more columns are included.

Value

A data frame of class decision_table with columns:

action

Action name (row name of V, or "action_1" etc.).

...

One column per state, named from column names of V.

EV_prior

Expected value of each action under the prior.

optimal_no_survey

Logical. TRUE for the best action without further information.

Examples

V <- matrix(c(55, 135, 100, 100), nrow = 2, byrow = TRUE,
            dimnames = list(c("translocate", "no_action"),
                            c("chytrid_present", "chytrid_absent")))
p <- c(0.5, 0.5)
voi_problem(V, p) |> optimize_action() |> decision_table()
#> ℹ VOI problem: 2 actions, 2 states, 2 experiment outcomes.
#> Error in optimize_action(voi_problem(V, p)): Run `transform_to_utility()` before `optimize_action()`.