|
Special Relativity in Financial Modeling 1.0.0
Lorentz transforms, spacetime classification, and geodesic price paths for quantitative finance
|
Online market-velocity β calculator (FIX-N mode). More...
#include <array>#include <cmath>#include <cstddef>Go to the source code of this file.
Classes | |
| class | srfm::stream::BetaCalculator< N > |
| Online β estimator with a sliding window of N log-returns. More... | |
Namespaces | |
| namespace | srfm |
| namespace | srfm::stream |
Typedefs | |
| using | srfm::stream::BetaCalculatorFix3 = BetaCalculator< 3u > |
| Convenience alias for the default FIX-3 mode used throughout this pipeline. | |
Variables | |
| constexpr double | srfm::stream::BETA_MAX_SAFE = 0.9999 |
| Maximum safe |β| — mirrors srfm::momentum::BETA_MAX_SAFE. | |
| constexpr double | srfm::stream::DEFAULT_C_MARKET = 0.02 |
Online market-velocity β calculator (FIX-N mode).
Module: include/srfm/stream/ Owner: AGT-10 (Builder) — 2026-03-01
Compute the normalised market velocity β used by the Lorentz transform:
log_return[i] = ln(close[i] / close[i-1]) velocity_raw = mean(log_return[last N bars]) β = clamp(velocity_raw / c_market, −BETA_MAX_SAFE, +BETA_MAX_SAFE)
where N is the FIX parameter (default 3) and c_market is a calibration constant representing the "speed of light" for this market (typical daily log-return magnitude used as the upper bound).
FIX-3 (N=3) means exactly 3 consecutive log-returns are averaged. This matches the original SRFM reference implementation's BetaCalculator.
• Online: O(1) per tick. • Bounded: stores exactly N+1 close prices. • Always valid: β ∈ (−BETA_MAX_SAFE, +BETA_MAX_SAFE) after warm-up. • Returns β = 0 until N+1 prices have been seen (conservative). • noexcept: update() and beta() are noexcept.
• Calibrating c_market (caller provides it at construction) • Cross-asset composition (compose_velocities in srfm::momentum)
Definition in file beta_calculator.hpp.