|
Special Relativity in Financial Modeling 1.0.0
Lorentz transforms, spacetime classification, and geodesic price paths for quantitative finance
|
#include <causal_cone.hpp>
Classes | |
| struct | Config |
| Configuration for the causal cone filter. More... | |
Public Member Functions | |
| CausalConeFilter (Config config=Config{}) noexcept | |
| Construct with an optional configuration. | |
| std::vector< CausalHistory > | build_histories (std::span< const core::OHLCV > bars, std::span< const manifold::SpacetimeEvent > events) const noexcept |
| std::optional< CausalSignal > | compute_signal (const CausalHistory &history, std::span< const double > returns, std::size_t bar_idx) const noexcept |
| std::size_t | look_back () const noexcept |
| Return the configured look_back window. | |
Filters a bar sequence to identify causal predecessors for each bar.
For every bar B in the sequence, looks back up to look_back bars and classifies each as TIMELIKE (causal) or SPACELIKE (excluded) using SpacetimeInterval::classify.
Usage:
Definition at line 115 of file causal_cone.hpp.
Construct with an optional configuration.
Definition at line 22 of file causal_cone.cpp.
|
noexcept |
Build a CausalHistory for every bar in the sequence.
The first look_back bars will have fewer predecessors as the rolling window fills up.
| bars | Sequence of OHLCV bars (must be pre-converted to events). |
| events | Corresponding spacetime events for each bar. |
bars). Definition at line 38 of file causal_cone.cpp.
|
noexcept |
Compute a CausalSignal for bar at index bar_idx.
| history | The CausalHistory for this bar. |
| returns | Close-to-close returns for the full bar sequence. |
| bar_idx | Index of the current bar in returns. |
Definition at line 87 of file causal_cone.cpp.
|
inlinenoexcept |
Return the configured look_back window.
Definition at line 163 of file causal_cone.hpp.