Quant techniques · market microstructure

Covariance when assets trade at different times

Two stocks rarely trade at exactly the same instant. If their last observed prices are forced onto a very fine common grid, many returns are zero or refer to different periods. The resulting covariance can be misleading. Hayashi–Yoshida uses the original observation intervals and pairs returns whenever those intervals overlap.

Overlap creates covariance information

Expected overlapping pairs

Illustrative 100-pair grid; the estimator uses overlapping return intervals, not matching timestamps.

What the estimator measures

Write XX and YY for two log-price processes. In a continuous diffusion model their integrated covariance over [0,T][0,T] is

∫0TσX(t)σY(t)ρ(t) dt.\int_0^T \sigma_X(t)\sigma_Y(t)\rho(t)\,dt.

When prices are observed on the same fine grid, a natural estimate is the sum of matching return products. With irregular asynchronous observations s0<s1<⋯s_0<s_1<\cdots for XX and t0<t1<⋯t_0<t_1<\cdots for YY, define increments ΔXi=Xsi−Xsi−1\Delta X_i=X_{s_i}-X_{s_{i-1}} and ΔYj=Ytj−Ytj−1\Delta Y_j=Y_{t_j}-Y_{t_{j-1}}. The Hayashi–Yoshida estimate is

[X,Y]^HY=∑i,jΔXiΔYj 1 ⁣((si−1,si]∩(tj−1,tj]≠∅).\widehat{[X,Y]}_{\rm HY} =\sum_{i,j}\Delta X_i\Delta Y_j\, \mathbf 1\!\left((s_{i-1},s_i]\cap(t_{j-1},t_j]\ne\varnothing\right).

Only intervals with positive-length overlap are counted; intervals that merely touch at an endpoint are not. Under suitable sampling and diffusion assumptions, as observations become dense the estimator converges to quadratic covariation. The diffusion expression above is the continuous-path case; with jumps, quadratic covariation also contains products of simultaneous jumps.

Work through the overlaps

Suppose XX is observed at 0, 2 and 4, with increments +0.01+0.01 and −0.02-0.02. YY is observed at 0, 1, 3 and 4, with increments +0.03+0.03, −0.01-0.01 and +0.02+0.02. The first XX interval overlaps the first two YY intervals; the second overlaps the last two. Therefore

[X,Y]^HY=(0.01)(0.03−0.01)+(−0.02)(−0.01+0.02)=0.\widehat{[X,Y]}_{\rm HY} =(0.01)(0.03-0.01)+(-0.02)(-0.01+0.02) =0.

This is an estimate of covariation over the observation window, in squared log-return units, not an annualized correlation. A correlation requires compatible variance estimates and a shared time window. In practice ensure both series cover the window consistently; an interval that extends beyond the boundary introduces exposure outside the intended window unless handled explicitly.

A simple implementation

The following clear implementation checks every pair, making it suitable for a small example. A production implementation can exploit sorted timestamps to visit overlapping intervals without constructing every pair.

import numpy as np

def hayashi_yoshida(tx, x, ty, y):
    """Log prices with strictly increasing timestamps on a shared window."""
    tx, x, ty, y = map(np.asarray, (tx, x, ty, y))
    if len(tx) != len(x) or len(ty) != len(y) or len(tx) < 2 or len(ty) < 2:
        raise ValueError("each price needs a timestamp and at least two observations")
    if np.any(np.diff(tx) <= 0) or np.any(np.diff(ty) <= 0):
        raise ValueError("timestamps must be strictly increasing")
    if tx[0] != ty[0] or tx[-1] != ty[-1]:
        raise ValueError("series must cover the same observation window")
    dx, dy = np.diff(x), np.diff(y)
    overlap = np.maximum(tx[:-1, None], ty[None, :-1]) < np.minimum(tx[1:, None], ty[None, 1:])
    return np.sum(dx[:, None] * dy[None, :] * overlap)

The code assumes timestamps support subtraction and comparison and that the observations at the shared boundaries are available. It does not solve cleaning, exchange-clock alignment, or microstructure noise.

What asynchrony does not explain

At very short horizons measured correlations often decrease, a phenomenon known as the Epps effect. Asynchronous observations can contribute, but delayed price discovery, market structure, and noise can also matter. The HY estimator addresses interval mismatch; it does not establish that all short-horizon correlation differences are sampling artifacts.

Before using the estimate

  • Bid–ask bounce and other observation noise can bias high-frequency covariance estimates; use an appropriate noise-robust method and study sampling sensitivity.
  • A pairwise covariance matrix assembled from asynchronous estimates need not be positive semidefinite. Portfolio optimization may require a compatible multivariate estimator or an explicit adjustment.
  • Covariance and correlation are different quantities. Make the variance estimators, sampling window and units consistent before normalizing.
  • Time stamps, trading halts, stale quotes and cross-venue clock differences require cleaning before estimation.

Practice

OverlapDoes an X return over (0, 2] pair with a Y return over (2, 3]?
Show answer

No. The intervals meet at 2 but have no positive-length overlap.

SynchronousWhat does the estimator become when both series use the same non-overlapping observation grid?
Show answer

Each interval overlaps only its counterpart, so the sum reduces to the usual sum of matching return products.

NoiseDoes using all asynchronous observations automatically eliminate bid–ask bounce?
Show answer

No. The basic estimator addresses nonsynchronous intervals, not observation noise.

Further reading: Voev and Lunde, Integrated Covariance Estimation using High-frequency Data in the Presence of Noise; Christensen, Kinnebrock, and Podolskij, Pre-averaging estimators of the ex-post covariance matrix.

Related: Realized variance and microstructure noise.