Learn R Programming

PortfolioTesteR (version 0.1.4)

wf_sweep_tabular: Walk-forward sweep of tabular configs (window-wise distribution of metrics)

Description

Walk-forward sweep of tabular configs (window-wise distribution of metrics)

Usage

wf_sweep_tabular(
  features_list,
  labels,
  prices,
  fit_fn,
  predict_fn,
  schedule = list(is = 104L, oos = 4L, step = 4L),
  grid = list(top_k = c(10L, 15L), temperature = c(8, 12), method = c("softmax", "rank"),
    transform = c("zscore")),
  caps = list(max_per_symbol = 0.08, max_per_group = NULL),
  group_map = NULL,
  freq = 52,
  cost_bps = 0,
  max_windows = NULL,
  ic_method = "spearman"
)

Value

data.table with medians/means across OOS windows.

Arguments

features_list

List of feature panels.

labels

Label panel.

prices

Price panel for backtests.

fit_fn, predict_fn

Model fit and predict functions.

schedule

List with elements is, oos, step.

grid

Named list of parameter vectors to sweep (e.g., top_k, temperature, method, transform).

caps

Exposure caps (e.g., max_per_symbol/max_per_group).

group_map

Optional Symbol->Group mapping for group caps/selection.

freq

Compounding frequency for annualization (e.g., 52 for weekly).

cost_bps

One-way trading cost in basis points (applied on rebalance).

max_windows

optional limit for speed.

ic_method

IC method ('spearman' or 'pearson').