voiageR is the thin R interface to the
voiage Python library. It exposes the stable EVPI, EVPPI,
and EVSI wrappers while keeping the package surface small, predictable,
and suitable for scripted use.
The examples below are intentionally non-interactive. They show the package shape, the Python environment setup, and the canonical data contracts without requiring the vignette build to depend on a live Python session.
If you manage Python through Conda, use:
model_func <- function(params) {
cbind(
Treatment = 50000 * params$mean_treatment - 3000,
Control = 50000 * params$mean_control
)
}
set.seed(17)
draws <- 1000L
prior_samples <- list(
mean_treatment = rnorm(draws, mean = 0.06, sd = 0.03),
mean_control = rnorm(draws, mean = 0.00, sd = 0.02),
sd_outcome = rep(1.0, draws)
)
trial_design <- list(
arms = list(
list(name = "Treatment", sample_size = 100L),
list(name = "Control", sample_size = 100L)
)
)
evsi(
model_func,
prior_samples,
trial_design,
method = "two_loop",
n_outer_loops = 100L,
n_inner_loops = 1000L,
seed = 20260724L
)The built-in model expects one
mean_<normalised arm> parameter for every trial arm.
It lowercases each arm name and replaces spaces with underscores.
sd_outcome is the known outcome standard deviation and is
fixed across the prior draws.
Custom trial-simulation and posterior-sampling callbacks remain Python-only. The R facade does not convert or execute those callbacks and does not claim custom-model parity.
The current R package exports the core analysis wrappers:
evpi() for expected value of perfect informationevppi() for expected value of partial perfect
informationevsi() for expected value of sample information
(built-in two-loop model and estimators)enbs() for expected net benefit of samplingThe package ships a deterministic PDF manual build helper at
tools/build-manual.R. It is designed for non-interactive
use from the package root and produces a stable manual artifact from the
package Rd files for release packaging and local verification.