FM_cov_matrix

FM_cov_matrix computes the integrated variance-covariance matrix of any number of processes from discrete observations, via the Fourier-Malliavin estimator with Fejer kernel

Syntax

  • var_cov_matrix=FM_cov_matrix(N,T,data)example

Description

FM_cov_matrix computes the integrated variance-covariance matrix of any number of processes from discrete observations over the time horizon [0,T], using the Fourier-Malliavin estimator with Fejer kernel

example

var_cov_matrix =FM_cov_matrix(N, T, data) Example of call of FM_cov_matrix.

Examples

expand all

  • Example of call of FM_cov_matrix.
  • The following example estimates the daily integrated variance of a univariate Heston model, from a discrete sample. The Heston model assumes that the spot variance follows a Cox-Ingersoll-Ross model.

    % Heston model simulation
    T=1; parameters=[0,0.4,2,1]; rho=-0.5;
    x0=log(100); V0=0.4;
    n=10000; [x1,V1,t1] = Heston1D(T,n,parameters,rho,x0,V0); 
    % Integrated variance estimation 
    data={x1,t1}; % Create the cell array of values-times data; x1 is a row or column vector containing the observed process values.
    %   t1 is a row or column vector with the same length of x1 containing the observation times over [0,T].
    var_cov_matrix = FM_cov_matrix(floor(n/2),T,data)
    var_cov_matrix =
    
        0.3357
    
    

    Related Examples

    expand all

  • Example of call of FM_cov_matrix with two processes.
  • The following example estimates the integrated variance-covariance of two processes from discrete samples of different sizes.

    T=1; 
    n1=1000; dt=1/n1; t1=0:dt:T; x1=randn(n1,1)*sqrt(dt); x1=[0;cumsum(x1)];
    n2=2000; dt=1/n2; t2=0:dt:T; x2=randn(n2,1)*sqrt(dt); x2=[0;cumsum(x2)];
    % Integrated covariance estimation 
    N=min(floor(n1/2),floor(n2/2)); % cutting frequency
    data={x1,t1,x2,t2}; % Create the cell array of values-times data; xi is a row or column vector containing the observed process values.
    %   ti is a row or column vector with the same length of xi containing the corresponding observation times over [0,T].
    var_cov_matrix = FM_cov_matrix(N,T,data)
    var_cov_matrix =
    
        1.0156   -0.0736
       -0.0736    1.0163
    
    

  • Example of call of FM_cov_matrix with three processes.
  • The following example estimates the integrated variance-covariance of three processes from discrete samples of different sizes.

    T=1; 
    n1=10000; dt=1/n1; t1=0:dt:T; x1=randn(n1,1)*sqrt(dt); x1=[0;cumsum(x1)];
    n2=5000; dt=1/n2; t2=0:dt:T; x2=randn(n2,1)*sqrt(dt); x2=[0;cumsum(x2)];
    n3=9000; dt=1/n3; t3=0:dt:T; x3=randn(n3,1)*sqrt(dt); x3=[0;cumsum(x3)];
    data={x1,t1,x2,t2,x3,t3}; % Create the cell array of values-times data; xi is a row or column vector containing the observed process values.
    %   ti is a row or column vector with the same length of xi containing the corresponding observation times over [0,T].
    N=2500; % cutting freq. 
    var_cov_matrix = FM_cov_matrix(N,T,data)
    var_cov_matrix =
    
        0.9733   -0.0078    0.0021
       -0.0078    0.9411   -0.0224
        0.0021   -0.0224    0.9928
    
    

    Input Arguments

    expand all

    N — Cutting frequency. Scalar.

    Data Types: single| double

    T — Estimation horizon. Scalar.

    Data Types: single| double

    data — Observed process values and observation times. Cell array.

    Cell array containing vectors of process values and observation times of different sizes.

    Data Types: single| double

    Output Arguments

    expand all

    var_cov_matrix —Integrated variances-covariance matrix. Matrix

    Returns a data matrix d x d of double.

    More About

    expand all

    Additional Details

    We assume that vectors xi contain discrete observations from a d-dimensional diffusion process $(x_1,..,x_d)$ following the Ito stochastic differential equation $$dx_i(t)= \sigma_i(t) \ dW_i(t) + b_i(t) \ dt, \quad i=1,...,d,$$ where, for all i, $W_i$ is a Brownian motion defined on the filtered probability space $(\Omega, (\mathcal{F}_t)_{t \in [0,T]}, P)$, while $\sigma_i$ and $b_i$ are random processes, adapted to $\mathcal{F}_t$.

    See the Reference for further mathematical details.

    The integrated covariance of the process $(x_i,x_j)$ on $[0,T]$ is defined as $$IC_{ij,[0,T]}:=\rho_{ij} \, \int_0^T \sigma_i(t) \sigma_j(t) \, dt$$ where $\rho_{ij}$ denotes the correlation between $W_i$ and $W_j$.

    For any positive integer $n_i$, let $\mathcal{S}^i_{n_i}:=\{ 0=t^i_{0}\leq \cdots \leq t^i_{n_i}=T \}$ be the observation times for the $i$-th asset. Moreover, let $\delta_l(x^i):= x^i(t^i_{l+1})-x^i(t^i_l)$ be the increments of $x^i$.

    The Fourier estimator of the integrated covariance with fejer kernel on $[0,T]$ is given by $$T c_0(c_{n_i,n_j,N})={T^2\over {N+1}} \sum_{|k|\leq N} \left( 1- \frac{|k|}{N+1}\right)c_{k}(dx^i_{n_1})c_{-k}(dx^j_{n_2}),$$ $$c_k(dx^i_{n_i})= {1\over {T}} \sum_{l=0}^{n_i-1} e^{-{\rm i}\frac{2\pi}{T}kt^i_l}\delta_{l}(x_i).$$

    References

    Mancino, M.E., Recchioni, M.C., Sanfelici, S. (2017), Fourier-Malliavin Volatility Estimation. Theory and Practice, "Springer Briefs in Quantitative Finance", Springer.

    Sanfelici, S., Toscano, G. (2024), The Fourier-Malliavin Volatility (FMVol) MATLAB toolbox, available on ArXiv.

    This page has been automatically generated by our routine publishFS