Read or convert causal history as an identified matrix
Source:R/history-frame.R
ledgr_history_matrix.RdWith a pulse context, ledgr_history_matrix() reads the same causal plan as
ledgr_history_frame() and manifests only a sessions-by-instruments double
matrix. With an existing history frame it is an adapter over that result and
reads no data. Both forms return an ordinary matrix with structural ledgr
provenance for ledgr_history_info(), ledgr_align_weights() and
ledgr_passed_warmup(). Registered arithmetic, replacement or subsetting
methods drop that provenance. Base or third-party operations that preserve
attributes may preserve it; ledgr does not authenticate transformed values.
Usage
ledgr_history_matrix(
x,
feature = NULL,
bar = NULL,
lookback,
instruments = "admissible",
min_observations = NULL,
min_instruments = 1L
)Arguments
- x
A pulse context or an existing
ledgr_historyframe.- feature
One active feature alias or registered feature ID.
- bar
One bar field:
"open","high","low","close"or"volume". Supply exactly one offeatureandbar.- lookback
Required.
Inffor all history from the data start, or a non-negative whole number of expected venue sessions ending at the cutoff.- instruments
"admissible","decision_axis", or a character vector of known instrument IDs.- min_observations
Minimum finite treated values required per instrument.
NULLrequires the finitelookback, or every returned session forlookback = Inf.- min_instruments
Minimum included instruments required for
ledgr_passed_warmup()to returnTRUE. It does not filter columns.
Value
A classed double matrix whose rows are expected sessions and whose columns are included instrument IDs.
Articles
Reading causal history:
vignette("causal-history", package = "ledgr")
system.file("doc", "causal-history.html", package = "ledgr")
A long-only minimum-variance strategy:
vignette("minimum-variance", package = "ledgr")
system.file("doc", "minimum-variance.html", package = "ledgr")