tracking_error

Defined in fynance.metrics

tracking_error(X, B, period=252)[source]

Annualized standard deviation of the active (strategy - benchmark) return.

Parameters:
Xnp.ndarray[float64, ndim=1]

Strategy price/level curve.

Bnp.ndarray[float64, ndim=1]

Benchmark price/level curve, same length as X.

periodint, optional

Number of periods per year, default is 252 (trading days).

Returns:
float

Annualized tracking error (always non-negative).

See also

information_ratio, beta

Notes

With \(x\)/\(b\) the strategy’s/benchmark’s simple returns:

\[TE = \sqrt{period \times Var(x - b)}\]

Examples

A strategy identical to its benchmark has a zero tracking error:

>>> import numpy as np
>>> X = np.array([100., 102., 101., 105., 110.])
>>> tracking_error(X, X)
0.0