Special Relativity in Financial Modeling 1.0.0
Lorentz transforms, spacetime classification, and geodesic price paths for quantitative finance
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
srfm::tensor::NAssetManifold Class Reference

(N+1)-dimensional Lorentzian manifold for N financial assets. More...

#include <n_asset_manifold.hpp>

Public Member Functions

 NAssetManifold (int n_assets, Eigen::MatrixXd covariance, double c_market=1.0) noexcept
 Construct an NAssetManifold directly.
 
int dim () const noexcept
 Returns the full manifold dimension = n_assets + 1.
 
int n_assets () const noexcept
 Returns the number of asset (spatial) dimensions.
 
std::optional< Eigen::MatrixXd > metric_at (const Eigen::VectorXd &x) const noexcept
 Evaluate the metric tensor at point x.
 
std::optional< Eigen::MatrixXd > inverse_metric_at (const Eigen::VectorXd &x) const noexcept
 Evaluate the inverse metric g^μν at point x.
 
std::optional< double > line_element_sq (const Eigen::VectorXd &x, const Eigen::VectorXd &dx) const noexcept
 Compute the squared line element ds² = g_μν dx^μ dx^ν.
 
bool is_flat () const noexcept
 Returns true if the metric has no coordinate dependence.
 
std::optional< Eigen::MatrixXd > covariance () const noexcept
 Returns the covariance matrix used to build the metric.
 
bool reduces_to_4d (const NAssetManifold &other) const noexcept
 Check structural compatibility with a 4D (N=3) manifold.
 
double c_market () const noexcept
 Return the market speed-of-light parameter.
 
const Eigen::MatrixXd & metric () const noexcept
 Direct metric accessor (no coordinate argument).
 
const Eigen::MatrixXd & inverse_metric () const noexcept
 Direct inverse metric accessor.
 

Static Public Member Functions

static std::optional< NAssetManifold > make (int n, Eigen::MatrixXd cov, double c_market=1.0) noexcept
 Factory: validate inputs then construct.
 

Detailed Description

(N+1)-dimensional Lorentzian manifold for N financial assets.

The manifold dimension is n_assets + 1 (one time axis plus N price axes). The metric is assembled from a user-supplied N×N positive-definite covariance matrix and a market speed-of-light parameter c_market.

Definition at line 48 of file n_asset_manifold.hpp.

Constructor & Destructor Documentation

◆ NAssetManifold()

srfm::tensor::NAssetManifold::NAssetManifold ( int  n_assets,
Eigen::MatrixXd  covariance,
double  c_market = 1.0 
)
noexcept

Construct an NAssetManifold directly.

Prefer the factory make() which validates inputs and returns std::nullopt on failure instead of constructing an invalid object.

Parameters
n_assetsNumber of asset price dimensions (spatial dimensions).
covarianceN×N positive-definite covariance matrix Σ.
c_marketMarket speed-of-light parameter (must be > 0).

Definition at line 17 of file n_asset_manifold.cpp.

Member Function Documentation

◆ c_market()

double srfm::tensor::NAssetManifold::c_market ( ) const
inlinenoexcept

Return the market speed-of-light parameter.

Returns
c_market_.

Definition at line 239 of file n_asset_manifold.hpp.

◆ covariance()

std::optional< Eigen::MatrixXd > srfm::tensor::NAssetManifold::covariance ( ) const
noexcept

Returns the covariance matrix used to build the metric.

Returns
The N×N covariance matrix, or std::nullopt on internal error.

Definition at line 141 of file n_asset_manifold.cpp.

◆ dim()

int srfm::tensor::NAssetManifold::dim ( ) const
inlinenoexcept

Returns the full manifold dimension = n_assets + 1.

Returns
n_assets_ + 1.

Definition at line 226 of file n_asset_manifold.hpp.

◆ inverse_metric()

const Eigen::MatrixXd & srfm::tensor::NAssetManifold::inverse_metric ( ) const
inlinenoexcept

Direct inverse metric accessor.

Returns the pre-built inverse metric matrix.

Returns
(N+1)×(N+1) inverse metric tensor.

Definition at line 247 of file n_asset_manifold.hpp.

◆ inverse_metric_at()

std::optional< Eigen::MatrixXd > srfm::tensor::NAssetManifold::inverse_metric_at ( const Eigen::VectorXd &  x) const
noexcept

Evaluate the inverse metric g^μν at point x.

Computed via LU decomposition of the metric matrix.

Parameters
xCoordinate vector of length dim().
Returns
The inverse metric, or std::nullopt on failure.

Definition at line 117 of file n_asset_manifold.cpp.

◆ is_flat()

bool srfm::tensor::NAssetManifold::is_flat ( ) const
inlinenoexcept

Returns true if the metric has no coordinate dependence.

For NAssetManifold the metric is always constant, so this always returns true.

Returns
true.

Definition at line 234 of file n_asset_manifold.hpp.

◆ line_element_sq()

std::optional< double > srfm::tensor::NAssetManifold::line_element_sq ( const Eigen::VectorXd &  x,
const Eigen::VectorXd &  dx 
) const
noexcept

Compute the squared line element ds² = g_μν dx^μ dx^ν.

Parameters
xBase point (unused for flat manifold, validated for dimension).
dxDisplacement vector of length dim().
Returns
ds², or std::nullopt if dimensions are inconsistent.

Definition at line 130 of file n_asset_manifold.cpp.

◆ make()

std::optional< NAssetManifold > srfm::tensor::NAssetManifold::make ( int  n,
Eigen::MatrixXd  cov,
double  c_market = 1.0 
)
staticnoexcept

Factory: validate inputs then construct.

Validates:

  • n_assets >= 1
  • covariance is N×N
  • covariance is symmetric
  • covariance is positive-definite (all eigenvalues > 0)
  • c_market > 0
Parameters
nNumber of assets.
covN×N covariance matrix.
c_marketMarket speed of light (default 1.0).
Returns
Constructed manifold or std::nullopt if inputs are invalid.

Definition at line 32 of file n_asset_manifold.cpp.

◆ metric()

const Eigen::MatrixXd & srfm::tensor::NAssetManifold::metric ( ) const
inlinenoexcept

Direct metric accessor (no coordinate argument).

Returns the pre-built constant metric matrix.

Returns
(N+1)×(N+1) metric tensor.

Definition at line 243 of file n_asset_manifold.hpp.

◆ metric_at()

std::optional< Eigen::MatrixXd > srfm::tensor::NAssetManifold::metric_at ( const Eigen::VectorXd &  x) const
noexcept

Evaluate the metric tensor at point x.

Because this is a constant (flat) manifold the result does not depend on x. The parameter is accepted for API uniformity with curved manifolds.

Returns a (N+1)×(N+1) matrix: row/col 0 → time component (g_00 = -c_market²) rows/cols 1..N → spatial block (g_ij = Σ_ij)

Parameters
xCoordinate vector of length dim() (unused for flat manifolds).
Returns
The metric matrix, or std::nullopt if x has wrong dimension.

Definition at line 108 of file n_asset_manifold.cpp.

◆ n_assets()

int srfm::tensor::NAssetManifold::n_assets ( ) const
inlinenoexcept

Returns the number of asset (spatial) dimensions.

Returns
n_assets_.

Definition at line 230 of file n_asset_manifold.hpp.

◆ reduces_to_4d()

bool srfm::tensor::NAssetManifold::reduces_to_4d ( const NAssetManifold &  other) const
noexcept

Check structural compatibility with a 4D (N=3) manifold.

Returns true if other has n_assets == 3 and this manifold's spatial block is consistent with being an extension of a 4D manifold. Concretely: returns true when other.n_assets() == 3 and this->n_assets() >= 3.

Parameters
otherManifold to compare against.
Returns
true if compatible.

Definition at line 145 of file n_asset_manifold.cpp.


The documentation for this class was generated from the following files: