run_drift_curve: Evaluate operating characteristics across a set of drift...

View source: R/study_wrapper.R

run_drift_curveR Documentation

Evaluate operating characteristics across a set of drift values

Description

For each drift value in drift_set, runs a simulation under the supplied theta0 (e.g. 0 for type I error, log(0.8) for power) and the given tuning parameters, then returns a stacked summary across drift values. The reference internal randomized sample size used for ESS is taken as nI1 + nI0 from scenario_base.

Usage

run_drift_curve(
  theta0,
  drift_set,
  scenario_base,
  lambdas,
  nsim = 1000,
  alpha = 0.025,
  seed = 1,
  parallel = FALSE,
  ncores = NULL,
  robust = FALSE,
  eps = SMOOTH_EPS,
  n_grid_opt = DEFAULT_N_GRID_OPT,
  keep_raw = FALSE
)

Arguments

theta0

True treatment effect (log HR) used in the simulations.

drift_set

Numeric vector of drift values (log HR).

scenario_base

A scenario list. theta0 and delta0 are overwritten internally for each drift value.

lambdas

Tuning list (as in run_simulation).

nsim

Number of replicates per drift value.

alpha

Nominal level.

seed

RNG seed (per-drift offsets are added internally).

parallel, ncores, robust, eps, n_grid_opt

As in run_simulation.

keep_raw

Retain replicate estimates. Defaults to FALSE.

Value

By default a data frame of per-drift summaries. With keep_raw = TRUE, a list with summary and raw. Replicate IDs are unique within each drift_index and method.


fdb documentation built on Oct. 4, 2026, 5:07 p.m.