tail_ratioΒΆ

Defined in fynance.features.metrics

tail_ratio(X, alpha=0.05, axis=0)[source]

Tail ratio of a return series.

Ratio of the magnitude of the right tail to the left tail: \(|q_{1-\alpha}| / |q_{\alpha}|\). A value above 1 means the upside tail is larger than the downside tail.

Parameters:
Xnp.ndarray[dtype, ndim=1 or 2]

Series of returns.

alphafloat, optional

Tail quantile level. Default 0.05 (95th vs 5th percentile).

axis{0, 1}, optional

Axis of computation. Default 0.

Returns:
float or np.ndarray

Tail ratio (0 when the left tail is exactly 0).