|
Special Relativity in Financial Modeling 1.0.0
Lorentz transforms, spacetime classification, and geodesic price paths for quantitative finance
|
Builds the Lorentzian metric tensor from a rolling correlation matrix. More...
#include <multi_asset.hpp>
Classes | |
| struct | Config |
| Construction parameters. More... | |
Public Member Functions | |
| CorrelationMetric (std::size_t n_assets, Config cfg={}) | |
| Construct with given configuration. | |
| std::optional< Eigen::MatrixXd > | update (const std::vector< double > &prices) |
| Add a new bar observation and update the metric. | |
| std::optional< Eigen::MatrixXd > | current_metric () const noexcept |
| Return the current metric tensor (last computed). | |
| std::optional< Eigen::MatrixXd > | correlation_matrix () const noexcept |
| Return the rolling correlation matrix (spatial block only). | |
| std::size_t | n_assets () const noexcept |
| Return the number of assets. | |
| std::size_t | observation_count () const noexcept |
| Return the number of observations seen so far. | |
| const Config & | config () const noexcept |
| Return the configuration. | |
| void | reset () noexcept |
| Reset the window (clears all observations). | |
Builds the Lorentzian metric tensor from a rolling correlation matrix.
Maintains a sliding window of N-asset price observations and computes the (N+1)×(N+1) metric tensor g_μν with:
The Cholesky decomposition of the spatial block is checked on every update; if the covariance matrix is not positive-definite (ill-conditioned or singular correlation), the metric is regularised by adding regularisation_eps × I to the spatial block.
Definition at line 131 of file multi_asset.hpp.
|
explicit |
Construct with given configuration.
Definition at line 103 of file multi_asset.cpp.
|
inlinenoexcept |
Return the configuration.
Definition at line 163 of file multi_asset.hpp.
|
noexcept |
Return the rolling correlation matrix (spatial block only).
Definition at line 151 of file multi_asset.cpp.
|
noexcept |
Return the current metric tensor (last computed).
Definition at line 146 of file multi_asset.cpp.
|
inlinenoexcept |
Return the number of assets.
Definition at line 157 of file multi_asset.hpp.
|
inlinenoexcept |
Return the number of observations seen so far.
Definition at line 160 of file multi_asset.hpp.
|
noexcept |
Reset the window (clears all observations).
Definition at line 167 of file multi_asset.cpp.
| std::optional< Eigen::MatrixXd > srfm::multi_asset::CorrelationMetric::update | ( | const std::vector< double > & | prices | ) |
Add a new bar observation and update the metric.
| prices | New price observations for each asset. |
Definition at line 116 of file multi_asset.cpp.