Skip to main content

Correlated Wieners

Math Background

Soon...

Usage

Example #1

import {stochastic} from 'stochastic-js';

// the correlation is constant and time-independent
const isConstant = true;
const n = 100;
const T = 1;
const rho = 0.02;

const {dW1, dw2, W1, W2} = stochastic.noises.correlatedWieners(
isConstant,
n,
T,
rho,
);

// dW is the increments of the Wiener process
// W is the generated sample of the Wiener process

Example #2

import {stochastic} from 'stochastic-js';

// the correlation comes from tanh transformed Ornstein-Uhlenbeck process
const isConstant = false;
const n = 100;
const T = 1;
const mu = 0.5;
const sigma = 0.5;
const theta = 8;

const {dW1, dw2, W1, W2} = stochastic.noises.correlatedWieners(
isConstant,
n,
T,
_,
mu,
sigma,
theta,
);

// dW1, dW2 are the increments of the Wiener processes
// W1, W2 are the generated sample of the Wiener processes

Example #3

import {stochastic} from 'stochastic-js';

// the correlation comes from tanh transformed fractional Ornstein-Uhlenbeck process
const isConstant = false;
const n = 100;
const T = 1;
const mu = 0.5;
const sigma = 0.5;
const theta = 8;
const H = 0.7;
const isRoughCorrelation = true;

const {dW1, dw2, W1, W2} = stochastic.noises.correlatedWieners(
isConstant,
n,
T,
_,
mu,
sigma,
theta,
_,
_,
H,
isRoughCorrelation,
);

// dW1, dW2 are the increments of the Wiener processes
// W1, W2 are the generated sample of the Wiener processes

Example #4

import {stochastic} from 'stochastic-js';

// the correlation comes from Jacobi process
const isConstant = false;
const n = 100;
const T = 1;
const sigma = 0.5;
const alpha = 0.5;
const beta = 0.5;
const H = 0.7;
const correlationProcess = 'jacobi';

const {dW1, dw2, W1, W2} = stochastic.noises.correlatedWieners(
isConstant,
n,
T,
_,
_,
sigma,
_,
alpha,
beta,
H,
isRoughCorrelation,
);

// dW1, dW2 are the increments of the Wiener processes
// W1, W2 are the generated sample of the Wiener processes