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::portfolio::SpacetimeCausalGraph Class Reference

#include <portfolio_manifold.hpp>

Public Member Functions

const Eigen::MatrixXi & adjacency_matrix () const noexcept
 
bool has_edge (std::size_t i, std::size_t j) const noexcept
 
std::size_t n_assets () const noexcept
 Return the number of assets (graph nodes).
 
int out_degree (std::size_t i) const noexcept
 Return the out-degree of node i (number of assets that i causally precedes).
 
int in_degree (std::size_t j) const noexcept
 Return the in-degree of node j (number of assets that causally precede j).
 
const std::vector< std::string > & asset_ids () const noexcept
 Return asset IDs in the order they were added.
 

Static Public Member Functions

static std::optional< SpacetimeCausalGraph > build (const MinkowskiCovariance &mc) noexcept
 

Detailed Description

Directed causal graph over a set of asset events.

An edge (i → j) is added when asset_i is TIMELIKE-separated from asset_j: ds²(i, j) < −LIGHTLIKE_THRESHOLD

Under the "causal influence hypothesis", a TIMELIKE edge means asset_i's price dynamics causally precede and may predict asset_j's dynamics.

Representation

The adjacency matrix A is an NxN boolean matrix (stored as Eigen::MatrixXi): A(i, j) = 1 iff ds²(i, j) < −LIGHTLIKE_THRESHOLD A(i, i) = 0 (no self-loops)

Usage

mc.add_asset(AssetEvent{"AAPL", 0.0, 150.0, 1e8, 2.4e12});
mc.add_asset(AssetEvent{"MSFT", 1.0, 290.0, 8e7, 2.1e12});
auto graph = SpacetimeCausalGraph::build(mc);
if (graph) {
auto adj = graph->adjacency_matrix();
// adj(0,1) == 1 means AAPL causally precedes MSFT
}
static std::optional< SpacetimeCausalGraph > build(const MinkowskiCovariance &mc) noexcept

Definition at line 182 of file portfolio_manifold.hpp.

Member Function Documentation

◆ adjacency_matrix()

const Eigen::MatrixXi & srfm::portfolio::SpacetimeCausalGraph::adjacency_matrix ( ) const
noexcept

Return the NxN adjacency matrix. A(i,j) = 1 means edge (i→j) exists (asset_i TIMELIKE before asset_j).

Definition at line 178 of file portfolio_manifold.cpp.

◆ asset_ids()

const std::vector< std::string > & srfm::portfolio::SpacetimeCausalGraph::asset_ids ( ) const
noexcept

Return asset IDs in the order they were added.

Definition at line 208 of file portfolio_manifold.cpp.

◆ build()

std::optional< SpacetimeCausalGraph > srfm::portfolio::SpacetimeCausalGraph::build ( const MinkowskiCovariance &  mc)
staticnoexcept

Build the causal graph from a MinkowskiCovariance instance.

Requires at least 2 asset events. Returns nullopt if fewer are available.

Parameters
mcMinkowskiCovariance with N >= 2 stored events.
Returns
SpacetimeCausalGraph, or nullopt on failure.

Definition at line 139 of file portfolio_manifold.cpp.

◆ has_edge()

bool srfm::portfolio::SpacetimeCausalGraph::has_edge ( std::size_t  i,
std::size_t  j 
) const
noexcept

Return true iff an edge (i → j) exists.

Parameters
iSource asset index (0-based).
jDestination asset index (0-based).

Definition at line 182 of file portfolio_manifold.cpp.

◆ in_degree()

int srfm::portfolio::SpacetimeCausalGraph::in_degree ( std::size_t  j) const
noexcept

Return the in-degree of node j (number of assets that causally precede j).

Definition at line 201 of file portfolio_manifold.cpp.

◆ n_assets()

std::size_t srfm::portfolio::SpacetimeCausalGraph::n_assets ( ) const
noexcept

Return the number of assets (graph nodes).

Definition at line 190 of file portfolio_manifold.cpp.

◆ out_degree()

int srfm::portfolio::SpacetimeCausalGraph::out_degree ( std::size_t  i) const
noexcept

Return the out-degree of node i (number of assets that i causally precedes).

Definition at line 194 of file portfolio_manifold.cpp.


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