91 [[nodiscard]]
static std::optional<double>
102 [[nodiscard]]
static std::optional<double>
138 std::span<const FourMomentum> trades,
140 double tolerance = 1e-9)
noexcept;
147 std::span<const FourMomentum> momenta)
noexcept;
189 [[nodiscard]]
static std::optional<Result>
optimize(
190 std::span<const double> returns,
191 std::span<
const std::array<double,3>> exposures,
192 const Config& cfg = {})
noexcept;
197 std::span<const double> weights,
198 std::span<const double> returns,
199 std::span<
const std::array<double,3>> exposures)
noexcept;
static bool conserves(std::span< const FourMomentum > trades, const FourMomentum &reference, double tolerance=1e-9) noexcept
static FourMomentum sum(std::span< const FourMomentum > momenta) noexcept
Stateless utility class for financial Minkowski four-momentum calculations.
static double invariant_mass_sq(const FourMomentum &p) noexcept
static double spatial_magnitude(const FourMomentum &p) noexcept
static double transverse_momentum(const FourMomentum &p) noexcept
static std::optional< double > rapidity(const FourMomentum &p) noexcept
static std::optional< double > invariant_mass(const FourMomentum &p) noexcept
static std::optional< Result > optimize(std::span< const double > returns, std::span< const std::array< double, 3 > > exposures, const Config &cfg={}) noexcept
Physical and financial constants for the SRFM system.
double energy
E — portfolio return (time-like component)
double pz
p_z — commodity exposure
double px
p_x — equity exposure
double py
p_y — bond exposure
int max_iterations
Maximum number of ascent steps.
double tolerance
Convergence criterion on m²
double min_weight
Lower bound on each weight.
double max_weight
Upper bound on each weight.
double learning_rate
Step size per iteration.
Result of a single optimisation run.
int iterations_used
Actual iterations taken.
bool converged
true if tolerance was reached
std::vector< double > weights
Optimal weight vector (sums to 1)
double max_inv_mass_sq
m² achieved at the optimum
Shared primitive types for the Special Relativity in Financial Modeling (SRFM) system.