benchmark_summaryΒΆ

Defined in fynance.metrics

benchmark_summary(X, B, period=252, rf=0.0)[source]

Standard benchmark-relative performance summary.

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).

rffloat, optional

Annualized risk-free rate passed to alpha. Default is 0.

Returns:
dict of str to float

beta, alpha, tracking_error, information_ratio, up_capture and down_capture.

See also

beta, alpha, tracking_error, information_ratio, capture_ratio

Examples

>>> import numpy as np
>>> X = np.array([100., 102., 101., 105., 103., 108.])
>>> s = benchmark_summary(X, X)
>>> sorted(s)
['alpha', 'beta', 'down_capture', 'information_ratio', 'tracking_error', 'up_capture']
>>> round(s['beta'], 6)
1.0