voiageR: R Interface to the Rust-backed voiage Library

voiageR provides an R interface to the Rust-backed voiage library for Value of Information (VOI) analysis. The source package includes and compiles the dependency-free Rust kernels used by its EVPI and ENBS paths.

Overview

Value of Information analysis estimates the value of collecting additional data to reduce uncertainty in decision-making. voiageR calls the shared Rust implementation directly for EVPI and ENBS. Advanced EVPPI and EVSI methods currently use the Python package through reticulate.

Installation

Prerequisites

Installing from source requires Rust 1.85 or newer and Cargo. The build is offline and has no third-party Rust dependencies. The installed package owns and loads its registered native routines; no separately installed VOIAGE shared library or environment variable is required.

For advanced evppi() and evsi() methods, install the Python voiage package and the R reticulate package:

pip install voiage
install.packages("reticulate")

The direct evpi() and enbs() paths do not require Python or reticulate.

Installing voiageR

You can install the development version of voiageR from GitHub:

# install.packages("devtools")
devtools::install_github("edithatogo/voiage", subdir = "r-package/voiageR")

Usage

library(voiageR)

# Create sample net benefit data
net_benefits <- matrix(rnorm(2000), nrow = 1000, ncol = 2)

# Calculate EVPI
evpi_value <- evpi(net_benefits)
print(evpi_value)

For more detailed examples, see the vignette:

vignette("voiageR-intro")

Built-in two-loop EVSI

The R facade supports the built-in joint-normal two-loop study model through the Python bridge. Each trial arm needs a matching prior parameter named mean_<normalised arm>: arm names are lowercased and spaces become underscores. The known outcome standard deviation is supplied as a finite, strictly positive sd_outcome fixed across all prior draws.

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)
  )
)
model_func <- function(params) {
  cbind(
    Treatment = 50000 * params$mean_treatment - 3000,
    Control = 50000 * params$mean_control
  )
}

evsi(
  model_func,
  prior_samples,
  trial_design,
  method = "two_loop",
  n_outer_loops = 100L,
  n_inner_loops = 1000L,
  seed = 20260724L
)

Custom trial_simulator and posterior_sampler callbacks remain Python-only. The R facade does not convert or execute them and does not claim custom-model parity.

Expected-utility information pricing

The experimental expected-utility information-pricing family, including the VoC presentation, is not exposed by voiageR. There is no governed C ABI or R wrapper for this family. Its machine-readable status remains unsupported in specs/frontier/expected-utility-information-pricing/v1/capabilities.json.

Functions

License

voiageR is licensed under the Apache License 2.0.