|
Special Relativity in Financial Modeling 1.0.0
Lorentz transforms, spacetime classification, and geodesic price paths for quantitative finance
|
#include <normalizer.hpp>
Public Member Functions | |
| CoordinateNormalizer (std::size_t window=20, std::size_t min_samples=0) noexcept | |
| std::optional< manifold::SpacetimeEvent > | normalize (const manifold::SpacetimeEvent &raw) noexcept |
| std::size_t | size () const noexcept |
| Number of samples currently in the rolling window (≤ window_size()). | |
| std::size_t | window_size () const noexcept |
| Configured maximum window size. | |
| std::size_t | total_samples () const noexcept |
| Total number of samples seen so far (does not saturate at window_size()). | |
| bool | warmed_up () const noexcept |
| void | reset () noexcept |
| Reset the normalizer, clearing all buffered observations. | |
Static Public Attributes | |
| static constexpr std::size_t | DEFAULT_MIN_SAMPLES = 20 |
| Minimum number of samples required before warmed_up() returns true. | |
Rolling z-score normalizer for SpacetimeEvent spatial coordinates.
Maintains independent rolling windows for price, volume, and momentum. Each call to normalize() updates the windows and returns a z-scored event.
Definition at line 62 of file normalizer.hpp.
|
explicitnoexcept |
Construct with a given window size and optional min_samples warm-up guard.
window — Number of bars to use for rolling statistics. Minimum 1. Default: 20.min_samples — Number of samples that must be seen before warmed_up() returns true and normalize() emits non-zero z-scores. Defaults to max(window, DEFAULT_MIN_SAMPLES). Definition at line 23 of file normalizer.cpp.
|
noexcept |
Normalize the spatial coordinates of a SpacetimeEvent.
Updates the rolling window with the current event's coordinates, then returns a new SpacetimeEvent where each spatial coordinate is z-scored using the updated window statistics.
SpacetimeEvent with:
If stddev < 1e-9 for a coordinate (flat series, no variance), that coordinate is returned as 0.0.
Definition at line 90 of file normalizer.cpp.
|
noexcept |
Reset the normalizer, clearing all buffered observations.
Definition at line 133 of file normalizer.cpp.
|
noexcept |
Number of samples currently in the rolling window (≤ window_size()).
Definition at line 116 of file normalizer.cpp.
|
noexcept |
Total number of samples seen so far (does not saturate at window_size()).
Definition at line 125 of file normalizer.cpp.
|
noexcept |
Returns true once at least min_samples data points have been accumulated.
Before warmed_up() is true, normalize() returns a zero-valued event to avoid producing wild z-scores from an insufficient statistical window.
Definition at line 129 of file normalizer.cpp.
|
noexcept |
Configured maximum window size.
Definition at line 121 of file normalizer.cpp.
|
staticconstexpr |
Minimum number of samples required before warmed_up() returns true.
Definition at line 65 of file normalizer.hpp.