arbitragelab.cointegration_approach.utils

Various utility functions used in cointegration/mean-reversion trading.

Module Contents

Functions

get_half_life_of_mean_reversion(→ float)

Get half-life of mean-reversion under the assumption that data follows the Ornstein-Uhlenbeck process.

get_hurst_exponent(→ float)

Hurst Exponent Calculation.

get_half_life_of_mean_reversion(data: pandas.Series) float

Get half-life of mean-reversion under the assumption that data follows the Ornstein-Uhlenbeck process.

Parameters:

data – (np.array) Data points.

Returns:

(float) Half-life of mean reversion.

get_hurst_exponent(data: numpy.array, max_lags: int = 100) float

Hurst Exponent Calculation.

Parameters:
  • data – (np.array) Time Series that is going to be analyzed.

  • max_lags – (int) Maximum amount of lags to be used calculating tau.

Returns:

(float) Hurst exponent.