|
Special Relativity in Financial Modeling 1.0.0
Lorentz transforms, spacetime classification, and geodesic price paths for quantitative finance
|
#include <relativistic_optimizer.hpp>
Public Member Functions | |
| RelativisticPortfolio (OptimizerConfig config=OptimizerConfig{}) noexcept | |
| Construct with optional configuration. | |
| void | add_asset (AssetEvent event, double expected_return) |
| std::size_t | n_assets () const noexcept |
| Return the number of assets currently in the portfolio. | |
| std::optional< Eigen::VectorXd > | relativistic_returns () const noexcept |
| std::optional< Eigen::MatrixXd > | spacetime_covariance () const noexcept |
| std::optional< OptimizationResult > | optimize_weights (double target_return, double risk_tolerance=1.0) const noexcept |
| void | clear () noexcept |
| Remove all assets from the portfolio. | |
Relativistic portfolio optimizer: Markowitz on the financial manifold.
The spacetime covariance matrix Σ_st is computed internally from the AssetEvents using MinkowskiCovariance and used as the geodesic metric.
Definition at line 106 of file relativistic_optimizer.hpp.
|
explicitnoexcept |
Construct with optional configuration.
Definition at line 33 of file relativistic_optimizer.cpp.
| void srfm::portfolio::RelativisticPortfolio::add_asset | ( | AssetEvent | event, |
| double | expected_return | ||
| ) |
Add an asset with its annualised expected return.
| event | AssetEvent providing spacetime coordinates. |
| expected_return | Annualised expected return for this asset (e.g. 0.10 = 10%). |
Definition at line 38 of file relativistic_optimizer.cpp.
|
noexcept |
Remove all assets from the portfolio.
Definition at line 48 of file relativistic_optimizer.cpp.
|
noexcept |
Return the number of assets currently in the portfolio.
Definition at line 44 of file relativistic_optimizer.cpp.
|
noexcept |
Run the relativistic portfolio optimization.
Formulates the problem as a geodesic minimization on the financial manifold and solves it via projected gradient descent on the simplex.
| target_return | Minimum required relativistic expected return. |
| risk_tolerance | Scalar multiplier on the geodesic risk term (higher = more risk-averse; default 1.0). |
Definition at line 160 of file relativistic_optimizer.cpp.
|
noexcept |
Compute the gamma-weighted (relativistic) expected return vector.
For each asset i: μ_rel_i = γ(β_i) · μ_i where β_i = |ΔP_i| / (c_market · |Δt_i|) approximated from the event coordinates relative to a reference event at the origin.
Definition at line 82 of file relativistic_optimizer.cpp.
|
noexcept |
Compute the NxN spacetime covariance matrix Σ_st.
Uses MinkowskiCovariance internally. Returns nullopt if fewer than 2 assets are loaded.
Definition at line 100 of file relativistic_optimizer.cpp.