Skip to main content

VarianceGammaProcess

Struct VarianceGammaProcess 

Source
pub struct VarianceGammaProcess {
    pub mu: f64,
    pub sigma: f64,
    pub nu: f64,
}
Expand description

The Variance-Gamma process: X_t = μ G_t + σ W_{G_t} where G_t is a Gamma process (subordinator) and W is a Brownian motion.

VG is a popular model in mathematical finance (Madan-Seneta model).

Fields§

§mu: f64

Drift parameter μ (asymmetry).

§sigma: f64

Volatility parameter σ.

§nu: f64

Variance rate ν of the Gamma subordinator.

Implementations§

Source§

impl VarianceGammaProcess

Source

pub fn new(mu: f64, sigma: f64, nu: f64) -> Self

Create a VG process with parameters (μ, σ, ν).

Source

pub fn simulate( &self, x0: f64, t_end: f64, n_steps: u32, seed: u64, ) -> Vec<(f64, f64)>

Simulate a VG path starting at x0 over [0, t_end] with n_steps steps.

At each step, sample dG ~ Gamma(dt/ν, 1/ν), then X += μ dG + σ √(dG) Z.

Source

pub fn theoretical_mean(&self, x0: f64, t: f64) -> f64

Theoretical mean of X_t: E[X_t] = x0 + μ t.

Source

pub fn theoretical_variance(&self, t: f64) -> f64

Theoretical variance of X_t: Var[X_t] = σ² t + μ² ν t.

Source

pub fn characteristic_exponent(&self, u: f64) -> f64

The VG characteristic exponent ψ(u) = log E[e^{iuX_1}].

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.