|
Special Relativity in Financial Modeling 1.0.0
Lorentz transforms, spacetime classification, and geodesic price paths for quantitative finance
|
CoordinateNormalizer — rolling z-score normalizer for SpacetimeEvent. More...
#include "srfm/manifold.hpp"#include <cassert>#include <cstddef>#include <deque>#include <optional>Go to the source code of this file.
Classes | |
| class | srfm::CoordinateNormalizer |
Namespaces | |
| namespace | srfm |
CoordinateNormalizer — rolling z-score normalizer for SpacetimeEvent.
Normalize the spatial coordinates of SpacetimeEvent instances using a rolling window of observed values before they are passed to SpacetimeInterval::compute.
Raw market coordinates differ by many orders of magnitude:
Without normalization, volume dominates ds² by ~10 orders of magnitude, making interval classification (timelike/spacelike) meaningless. After z-score normalization each coordinate contributes equally.
For each spatial coordinate x, rolling window of n observations: x_norm = (x - rolling_mean(x)) / rolling_stddev(x)
Time coordinate passes through unchanged.
Before at least min_samples data points have been accumulated (default = window_size, minimum 20), the z-scores are potentially unreliable due to insufficient statistical history. warmed_up() returns false during this period, and normalize() returns a zero-valued event (all spatial coordinates set to 0.0 with time unchanged) instead of a potentially wild z-score. Callers should check warmed_up() before using the output of normalize() for trading decisions.
Definition in file normalizer.hpp.