Implementation:Avhz RustQuant FractionalBrownianMotion
| Knowledge Sources | |
|---|---|
| Domains | Stochastic_Processes, Quantitative_Finance |
| Last Updated | 2026-02-07 19:00 GMT |
Overview
Concrete implementation of Fractional Brownian Motion (fBM) provided by the RustQuant library.
Description
Fractional Brownian Motion is a generalization of standard Brownian Motion that exhibits long-range dependence controlled by the Hurst parameter H. Unlike standard BM, the increments of fBM are not independent -- they exhibit positive correlation (persistence) for H > 0.5, negative correlation (anti-persistence) for H < 0.5, and reduce to standard Brownian Motion for H = 0.5.
The process has zero drift and unit diffusion in its SDE representation, but uses fractional Gaussian noise (fGN) instead of standard Gaussian noise. The fGN can be generated via two methods:
- CHOLESKY -- Cholesky decomposition of the autocovariance matrix (exact but O(n^3))
- FFT -- Davies-Harte method using FFT (faster, O(n log n))
Key parameters:
- hurst (f64) -- The Hurst parameter, must be in [0, 1]
- method (FractionalProcessGeneratorMethod) -- Method to generate fGN (CHOLESKY or FFT)
Usage
Use this process when modeling phenomena with long-range dependence or self-similarity, such as network traffic, hydrology, or financial markets exhibiting persistent or anti-persistent behavior. The Hurst parameter controls the memory: H > 0.5 for trending behavior, H < 0.5 for mean-reverting behavior.
Code Reference
Source Location
- Repository: RustQuant
- File: crates/RustQuant_stochastics/src/fractional_brownian_motion.rs
- Lines: 1-98
Signature
#[derive(Debug)]
pub struct FractionalBrownianMotion {
pub hurst: f64,
pub method: FractionalProcessGeneratorMethod,
}
impl FractionalBrownianMotion {
pub fn new(hurst: f64, method: FractionalProcessGeneratorMethod) -> Self
}
impl Default for FractionalBrownianMotion {
fn default() -> Self // hurst=0.5, method=FFT
}
impl StochasticProcess for FractionalBrownianMotion {
fn drift(&self, _x: f64, _t: f64) -> f64 // returns 0.0
fn diffusion(&self, _x: f64, _t: f64) -> f64 // returns 1.0
fn jump(&self, _x: f64, _t: f64) -> Option<f64>
fn parameters(&self) -> Vec<f64>
fn generate(&self, config: &StochasticProcessConfig) -> Trajectories
}
Import
use RustQuant::stochastics::FractionalBrownianMotion;
use RustQuant::stochastics::FractionalProcessGeneratorMethod;
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| hurst | f64 | Yes | The Hurst parameter, must be in [0, 1]. H=0.5 gives standard BM. |
| method | FractionalProcessGeneratorMethod | Yes | Method for generating fractional Gaussian noise (CHOLESKY or FFT) |
Outputs
| Name | Type | Description |
|---|---|---|
| drift() | f64 | Always returns 0.0 |
| diffusion() | f64 | Always returns 1.0 |
| jump() | Option<f64> | Always returns None |
| parameters() | Vec<f64> | Returns [hurst] |
| generate() | Trajectories | Simulated paths using fractional Gaussian noise |
Usage Examples
use RustQuant::stochastics::FractionalBrownianMotion;
use RustQuant::stochastics::FractionalProcessGeneratorMethod;
use RustQuant::stochastics::{StochasticProcessConfig, StochasticScheme};
// Create an fBM with Hurst parameter 0.7 using FFT method
let fbm = FractionalBrownianMotion::new(0.7, FractionalProcessGeneratorMethod::FFT);
// Configure simulation: x0=0.0, t_start=0.0, t_end=0.5, n_steps=100, 1000 paths
let config = StochasticProcessConfig::new(
0.0, 0.0, 0.5, 100, StochasticScheme::EulerMaruyama, 1000, false, None
);
let output = fbm.generate(&config);
// Access simulated paths
let paths = &output.paths;