Heston2D

Heston2D simulates observations and instantaneous variances from the bivariate Heston model

Syntax

Description

Heston2D simulates, using the Euler–Maruyama method, observations and instantaneous variances from a 2-dimensional version of the model by [S. Heston, The Review of Financial Studies, Vol. 6, No. 2, 1993].

example

x =Heston2D(T, n, parameters, Rho, x0, V0) Example of call of Heston2D for obtaining process observations only.

example

[x, V] =Heston2D(___) Example of call of Heston2D for obtaining process observations and volatility values.

example

[x, V, t] =Heston2D(___) Example of call of Heston2D for obtaining process observations, volatility values and sampling times.

Examples

expand all

  • Example of call of Heston2D for obtaining process observations only.
  • Generates observations from the bivariate Heston model.

    T=1;  
    n=23400;   
    parameters=[0,0;0.4,0.4;2,2;1,1];
    Rho=[0.5;-0.5;0;0;-0.5;0.5];
    x0=[log(100),log(100)]; 
    V0=[0.4,0.4];
    x = Heston2D(T,n,parameters,Rho,x0,V0);  
    figure
    subplot(2,1,1)
    plot(x(:,1))
    ylabel('Observed values of process 1')
    title('Heston model')
    subplot(2,1,2)
    plot(x(:,2))
    ylabel('Observed values of process 2')
    title('Heston model')
    Click here for the graphical output of this example (link to Ro.S.A. website).

  • Example of call of Heston2D for obtaining process observations and volatility values.
  • Generates observations and volatilities from the bivariate Heston model.

    T=1; 
    n=23400; 
    parameters=[0,0;0.4,0.4;2,2;1,1];
    Rho=[0.5,-0.5,0,0,-0.5,0.5];
    x0=[log(100),log(100)]; V0=[0.4,0.4];
    [x,V] = Heston2D(T,n,parameters,Rho,x0,V0); 
    figure
    subplot(2,1,1)
    plot(x(:,1))
    ylabel('Observed values of process 1')
    title('Heston model')
    subplot(2,1,2)
    plot(x(:,2))
    ylabel('Observed values of process 2')
    title('Heston model')
    figure
    subplot(2,1,1)
    plot(V(:,1))
    ylabel('Spot variance of process 1')
    title('Heston model')
    subplot(2,1,2)
    plot(V(:,2))
    ylabel('Spot variance of process 2')
    title('Heston model')
    Click here for the graphical output of this example (link to Ro.S.A. website).

  • Example of call of Heston2D for obtaining process observations, volatility values and sampling times.
  • Generates observations, volatilities and sampling times from the bivariate Heston model.

    T=1; 
    n=23400; 
    parameters=[0,0;0.4,0.4;2,2;1,1];
    Rho=[0.5,-0.5,0,0,-0.5,0.5];
    x0=[log(100),log(100)]; V0=[0.4,0.4];
    [x,V,t] = Heston2D(T,n,parameters,Rho,x0,V0); 
    figure
    subplot(2,1,1)
    plot(t,x(:,1))
    xlabel('Time')
    ylabel('Observed values of process 1')
    title('Heston model')
    subplot(2,1,2)
    plot(t,x(:,2))
    xlabel('Time')
    ylabel('Observed values of process 2')
    title('Heston model')
    figure
    subplot(2,1,1)
    plot(t,V(:,1))
    xlabel('Time')
    ylabel('Spot variance of process 1')
    title('Heston model')
    subplot(2,1,2)
    plot(t,V(:,2))
    xlabel('Time')
    ylabel('Spot variance of process 2')
    title('Heston model')
    Click here for the graphical output of this example (link to Ro.S.A. website).

    Input Arguments

    expand all

    T — Time horizon. Scalar.

    Data Types: single| double

    n — Number of simulated observation. Scalar.

    Data Types: single| double

    parameters — Model parameters. Matrix.

    Matrix with 4 rows and 2 columns.

    Data Types: single| double

    Rho — Correlation vector. Vector.

    Vector of dimension 6.

    Data Types: single| double

    x0 — Initial process observation values. Vector.

    Vector of dimension 2.

    Data Types: single| double

    V0 — Initial variance values. Vector.

    Vector of dimension 2.

    Data Types: single| double

    Output Arguments

    expand all

    x —Process observations. Matrix

    Matrix with n+1 rows and 2 columns.

    V —Spot variance values. Matrix

    Matrix with n+1 rows and 2 columns.

    t —Observation times. Vector

    Vector of dimension n+1.

    More About

    expand all

    Additional Details

    A bivariate version of the Heston model [S. Heston, The Review of Financial Studies, Vol. 6, No. 2, 1993] is given by the following stochastic differential equations: $$\left\{\begin{array}{l} dx^i(t)=\left( \mu_{i}-\frac{1}{2} v^i(t) \right) \, dt + \sqrt{v^i(t)} \, dW^i_t \\ dv^i(t)=\theta_{i} \, \left( \alpha_{i}- v^i(t) \right) \, dt + \gamma_{i} \, \sqrt{v^i(t)}\, dZ^i_t \end{array}\right. ,\quad i=1,2,$$ where, for each i, $v^i:=(\sigma^i)^2$, $\mu_i$ is a real-valued constant, $\theta_i, \, \alpha_i$ and $\gamma_i$ are positive constants, and $W_i$ and $Z_i$ are Brownian motions that are correlated with each other and with $W_j$ and $Z_j$, $j \neq i$.

    References

    Heston, S. (1993), A closed-form solution for options with stochastic volatility with applications to bond and currency options, The Review of Financial Studies, Vol. 6, No. 2.

    See Also

    This page has been automatically generated by our routine publishFS