Skip to contents

ledgr_return_panel() constructs the classed return-panel evidence object consumed by ledgr's selection-integrity diagnostics. The input is clean period returns: do not include the structural first-row NA used by retained sweep returns. Use ledgr_sweep_returns_panel() for the sweep-sourced accessor.

Usage

ledgr_return_panel(returns, ts = NULL, value = c("returns"))

Arguments

returns

A wide numeric matrix/data frame with one candidate per column, or a tidy long data frame with candidate_id and period_return columns plus at most one ordering column (ts_utc, ts, period_label, or period).

ts

Optional Date or POSIXct ordering labels for wide inputs. When NULL, deterministic labels period_000001, period_000002, ... are used.

value

Character scalar. Only "returns" is supported in v1.

Value

A ledgr_return_panel object.

Examples

returns <- data.frame(
  conservative = c(0.004, -0.011, 0.006, 0.002),
  balanced = c(0.009, -0.004, 0.012, -0.001)
)
panel <- ledgr_return_panel(returns)
panel$panel_hash
#> [1] "277fc2384b08dad68217e55d7d016b91bd4b05c3a1eefcab68e90023f857b42a"