Skip to main content

MultiAssetGbmProcess

Struct MultiAssetGbmProcess 

Source
pub struct MultiAssetGbmProcess {
    pub drift_rates: Vec<f64>,
    pub vols: Vec<f64>,
    pub chol: Vec<Vec<f64>>,
}
Expand description

N correlated lognormal assets as one N-state, N-factor process:

dS_i = (r - q_i) S_i dt + sigma_i S_i dW_i,   d<W_i, W_j> = rho_ij dt

The correlation enters through the rows of the lower-triangular Cholesky factor, so dw carries independent increments (the StochasticProcess contract). evolve overrides the generic Euler with the exact per-asset lognormal transition — under constant coefficients the joint law is exact at any step size, so coarse grids only cost monitoring resolution, never bias.

Fields§

§drift_rates: Vec<f64>

Per-asset risk-neutral drift rates r - q_i.

§vols: Vec<f64>§chol: Vec<Vec<f64>>

Lower-triangular Cholesky factor of the asset correlation matrix.

Trait Implementations§

Source§

impl StochasticProcess for MultiAssetGbmProcess

Source§

fn dim(&self) -> usize

Number of state variables.
Source§

fn factors(&self) -> usize

Number of driving Brownian factors (dw.len()).
Source§

fn drift(&self, _t: f64, x: &[f64], out: &mut [f64])

Drift vector a(t, x) into out (dim long).
Source§

fn diffusion(&self, _t: f64, x: &[f64], out: &mut [f64])

Diffusion matrix b(t, x) into out, row-major dim × factors.
Source§

fn evolve(&self, _t: f64, x: &[f64], dt: f64, dw: &[f64], out: &mut [f64])

One Euler-Maruyama step from x into out. The default allocates small scratch buffers; hot loops should override with model-specific stepping (which is also where non-Euler schemes — exact transitions, Heston full-truncation/QE — live, since generic multi-factor Milstein would need Lévy areas).
Source§

fn constrain(&self, _x: &mut [f64])

State constraint applied after every step (identity by default).

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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V