Module RustQuant::stochastics

source ·
Expand description

Monte Carlo engines to simulate stochastic processes.

The following is a list of stochastic processes that can be generated.

  • Brownian Motions:
    • Standard Brownian Motion
      • $dX(t) = dW(t)$
    • Arithmetic Brownian Motion
      • $dX(t) = \mu dt + \sigma dW(t)$
    • Geometric Brownian Motion
      • $dX(t) = \mu X(t) dt + \sigma X(t) dW(t)$
    • Fractional Brownian Motion
  • Cox-Ingersoll-Ross (1985)
    • $dX(t) = \left[ \theta - \alpha X(t) \right] dt + \sigma \sqrt{r_t} dW(t)$
  • Ornstein-Uhlenbeck process
    • $dX(t) = \theta \left[ \mu - X(t) \right] dt + \sigma dW(t)$
  • Ho-Lee (1986)
    • $dX(t) = \theta(t) dt + \sigma dW(t)$
  • Hull-White (1990)
    • $dX(t) = \left[ \theta(t) - \alpha X(t) \right]dt + \sigma dW(t)$
  • Extended Vasicek (1990)
    • $dX(t) = \left[ \theta(t) - \alpha(t) X(t) \right] dt + \sigma dW(t)$
  • Black-Derman-Toy (1990)
    • $d\ln[X(t)] = \left[ \theta(t) + \frac{\sigma’(t)}{\sigma(t)}\ln[X(t)] \right]dt + \sigma_t dW(t)$
use RustQuant::stochastics::*;
use RustQuant::models::*;

// Create new GBM with mu and sigma.
let gbm = GeometricBrownianMotion::new(0.05, 0.9);

// Generate path using Euler-Maruyama scheme.
// Parameters: x_0, t_0, t_n, n, sims, parallel.
let output = (&gbm).euler_maruyama(10.0, 0.0, 0.5, 10, 1, false);

println!("GBM = {:?}", output.paths);

Re-exports§

Modules§