Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Avhz RustQuant FractionalProcess

From Leeroopedia


Knowledge Sources
Domains Stochastic_Processes, Quantitative_Finance
Last Updated 2026-02-07 19:00 GMT

Overview

Infrastructure module for generating Fractional Gaussian Noise (fGN) and simulating fractional stochastic processes in the RustQuant library.

Description

This module provides the core machinery for fractional stochastic process simulation. It includes:

  • FractionalProcessGeneratorMethod enum -- Selects between Cholesky decomposition and FFT (Davies-Harte) methods for generating Fractional Gaussian Noise.
  • simulate_fractional_stochastic_process function -- Orchestrates Monte Carlo simulation for any StochasticProcess using fractional noise.
  • fgn_cholesky function -- Generates fGN via Cholesky decomposition of the autocovariance matrix. Exact but O(n^3) complexity.
  • fgn_fft function -- Generates fGN via the Davies-Harte FFT method. Approximate but O(n log n) complexity.

The autocovariance function (ACF) of fBM increments is computed as:

gamma(k) = 0.5 * (|k+1|^(2H) - 2|k|^(2H) + |k-1|^(2H))

where H is the Hurst parameter.

Usage

This module is used internally by fractional process implementations (FractionalBrownianMotion, FractionalOrnsteinUhlenbeck, FractionalCoxIngersollRoss). Use the FractionalProcessGeneratorMethod enum to select the noise generation algorithm. The Cholesky method is exact but slower for large sample sizes; the FFT method is faster and suitable for most practical applications.

Code Reference

Source Location

Signature

#[derive(Debug)]
pub enum FractionalProcessGeneratorMethod {
    CHOLESKY,
    FFT,
}

pub(crate) fn simulate_fractional_stochastic_process<T: StochasticProcess>(
    stochastic_process: &T,
    config: &StochasticProcessConfig,
    method: &FractionalProcessGeneratorMethod,
    hurst: f64,
) -> Trajectories

pub fn fgn_cholesky(hurst: f64, n: usize, t_n: f64, seed: Option<u64>) -> Vec<f64>

pub fn fgn_fft(hurst: f64, n: usize, t_n: f64, _: Option<u64>) -> Vec<f64>

Import

use RustQuant::stochastics::FractionalProcessGeneratorMethod;

I/O Contract

Inputs

Name Type Required Description
hurst f64 Yes Hurst parameter in [0, 1]
n usize Yes Number of time steps
t_n f64 Yes Terminal time
seed Option<u64> No Optional random seed (Cholesky method only)
method FractionalProcessGeneratorMethod Yes CHOLESKY or FFT

Outputs

Name Type Description
fgn_cholesky() Vec<f64> Fractional Gaussian noise vector of length n via Cholesky decomposition
fgn_fft() Vec<f64> Fractional Gaussian noise vector of length n via FFT (Davies-Harte)
simulate_fractional_stochastic_process() Trajectories Monte Carlo simulated trajectories using fractional noise

Usage Examples

use RustQuant::stochastics::FractionalBrownianMotion;
use RustQuant::stochastics::FractionalProcessGeneratorMethod;
use RustQuant::stochastics::{StochasticProcessConfig, StochasticScheme};

// The fractional process infrastructure is used internally.
// To use it, create a fractional stochastic process:
let fbm = FractionalBrownianMotion::new(0.7, FractionalProcessGeneratorMethod::CHOLESKY);

let config = StochasticProcessConfig::new(
    0.0, 0.0, 1.0, 1000, StochasticScheme::EulerMaruyama, 100, false, None
);

// generate() internally calls simulate_fractional_stochastic_process
let output = fbm.generate(&config);

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment