Skip to main content

Module stochastic

Module stochastic 

Source
Expand description

Stochastic finance/economics kernels.

The legacy public helpers are convenience APIs. The seeded *_into variants are the deterministic, caller-buffered kernels to prefer for tests, WASM, and any future hot-path integration.

Enums§

StochasticError

Constants§

DEFAULT_MONTE_CARLO_SEED
Default seed for deterministic Monte Carlo callers that do not supply their own scenario seed.

Functions§

run_monte_carlo_var
Runs a Monte Carlo simulation to calculate the expected end value and the Value at Risk (VaR) at a 95% confidence interval.
run_monte_carlo_var_seeded_into
Runs a deterministic Monte Carlo VaR calculation into a caller-owned buffer.
simulate_gbm_path
Simulates a single path of Geometric Brownian Motion (GBM) using the ambient random source. Kept for compatibility with existing CLI/WASM surfaces.
simulate_gbm_path_seeded
Deterministic single-path GBM simulation.
simulate_gbm_steps_into
Writes each GBM step price into out. Returns the number of prices written.