Define a VOI problem from probability distributions
Source:R/voi_problem.R
voi_problem_from_dist.RdBuilds a voi_problem by sampling outcomes from distributions rather than
from a fixed matrix. States are represented by Monte Carlo samples.
Usage
voi_problem_from_dist(
action_fns,
p_prior = NULL,
n_samples = 10000L,
val_min = NULL,
val_max = NULL,
p_posterior_fns = NULL,
pp = NULL,
verbose = FALSE
)Arguments
- action_fns
A named list of functions, one per action. Each function takes a single argument
nand returnsnsampled outcomes from that action's outcome distribution. Names become row names of V.- p_prior
Numeric vector of state probabilities, OR
NULLif using continuous distributions (in which case equal weights are used).- n_samples
Integer. Number of Monte Carlo samples per action (default 10000).
- val_min
Numeric. Minimum plausible outcome (for range-coverage check).
- val_max
Numeric. Maximum plausible outcome (for range-coverage check).
- p_posterior_fns
Optional: named list of lists, one per experiment outcome. Each entry is a list of action functions as in
action_fns, representing the outcome distribution after observing that result. Used for EVPXI/EVSI.- pp
Numeric vector of experiment outcome probabilities (same length as
p_posterior_fns). Ignored ifp_posterior_fnsisNULL.- verbose
Logical. If
TRUE, prints a note explaining the equal-weight approximation used whenp_posterior_fnsis supplied. DefaultFALSE.
Limitations
When p_posterior_fns is supplied, the posterior probability matrix is
approximated using equal weights over the prior samples. For an exact
EVPXI calculation, derive the posterior probabilities analytically and
supply them directly to voi_problem().