Skip to contents

ledgr_walk_forward() orchestrates fold-local train sweeps, deterministic scalar candidate selection, and selected-candidate test runs over the existing ledgr_sweep() and ledgr_run() execution machinery. The returned object carries a degradation table that compares the selected train score to the selected test score before secondary result surfaces.

Usage

ledgr_walk_forward(
  exp,
  grid,
  folds,
  selection_rule,
  seed = NULL,
  opening_state_policy = c("carry_test_state", "flat_test_state"),
  ...
)

Arguments

exp

A ledgr_experiment.

grid

A ledgr_param_grid.

folds

A ledgr_fold_list.

selection_rule

A rule created by ledgr_select_argmax() or ledgr_select_argmin().

seed

Optional master seed for deterministic per-row execution seeds.

opening_state_policy

Either "carry_test_state" or "flat_test_state". The default carries selected test-run terminal state into the next test run. Flat-test state is an explicit cold-start opt-in.

...

Reserved for later walk-forward options.

Value

A ledgr_walk_forward_results list with folds, scores, selected, degradation, and selected test-run handles.

Details

v1 walk-forward scores scalar train-window candidates, selects one candidate per fold, and runs only that selected candidate on the matching test window. It is not PBO, CSCV, CPCV, DSR, benchmark-relative diagnostics, OMS, paper/live trading, or a selection-integrity correction. Walk-forward evidence is only as survivorship-safe as the sealed snapshot and universe semantics it evaluates.

With the default opening_state_policy = "carry_test_state", test windows are path-dependent: each completed selected test run can seed the next test opening state. Per-fold test metrics are therefore not independent. Anchored fold definitions intentionally grow the train window over time, so compute cost grows with later folds and larger candidate grids. metric_diff_abs is test_metric_value - train_metric_value; whether a positive value indicates improvement or degradation depends on the selection rule direction.