Hurst Exponent Estimator
Hurst Exponent Estimator
hurst_dma(prices, min_chunksize=8, max_chunksize=200, num_chunksize=5)
Estimate the Hurst exponent using the DMA method.
Estimates the Hurst (H) exponent using the DMA method from the time series.
The DMA method consists on calculate the moving average of size series_len
and subtract it to the original series and calculating the standard
deviation of that result. This repeats the process for several series_len
values and adjusts data regression to obtain the H. series_len
will take
values between min_chunksize
and max_chunksize
, the step size from
min_chunksize
to max_chunksize
can be controlled through the parameter
step_chunksize
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
prices |
array
|
A time series to calculate hurst exponent, must have more elements than |
required |
min_chunksize |
int
|
This parameter allow you control the minimum window size. |
8
|
max_chunksize |
int
|
This parameter allow you control the maximum window size. |
200
|
num_chunksize |
int
|
This parameter allow you control the size of the step from minimum to maximum window size. Bigger step means fewer calculations. |
5
|
Returns:
Type | Description |
---|---|
float
|
Estimation of hurst exponent. |
References
Alessio, E., Carbone, A., Castelli, G. et al. Eur. Phys. J. B (2002) 27:
197. http://dx.doi.org/10.1140/epjb/e20020150
Source code in ceruleo/transformation/features/hurst.py
hurst_dsod(x)
Estimate Hurst exponent on data timeseries using the DSOD (Discrete Second Order Derivative).
The estimation is based on the discrete second order derivative. Consists on get two different noise of the original series and calculate the standard deviation and calculate the slope of two point with that values. source: https://gist.github.com/wmvanvliet/d883c3fe1402c7ced6fc
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x |
array
|
Time series to estimate the Hurst exponent for. |
required |
Returns:
Type | Description |
---|---|
float
|
Estimation of the Hurst exponent for the given time series. |
References
Istas, J.; G. Lang (1994), “Quadratic variations and estimation of the local
Hölder index of data Gaussian process,” Ann. Inst. Poincaré, 33, pp. 407–436.
Notes
This hurst_ets is data literal traduction of wfbmesti.m of waveleet toolbox from matlab.
Source code in ceruleo/transformation/features/hurst.py
hurst_exponent(prices, min_chunksize=8, max_chunksize=200, num_chunksize=5, method='RS')
Estimates Hurst Exponent.
Estimate the hurst exponent following one of 3 methods. Each method
Parameters:
Name | Type | Description | Default |
---|---|---|---|
prices |
Option[ndarray, Series, DataFrame]
|
A time series to estimate hurst exponent. |
required |
min_chunksize |
int, optional Minimum chunk size of the original series. This parameter doesn't have any effect with DSOD method, by default 8 |
8
|
|
max_chunksize |
int, optional Maximum chunk size of the original series. This parameter doesn't have any effect with DSOD method. by default 200. |
200
|
|
num_chunksize |
int, optional Step used to select next the chunk size which divide the original series. This parameter doesn't have any effect with DSOD method, by default 5. |
5
|
|
method |
{'RS', 'DMA', 'DSOD', 'all'}. Valid values are: RS : rescaled range, DMA : deviation moving average, DSOD : discrete second order derivative. |
'RS'
|
Returns:
Type | Description |
---|---|
float
|
Estimation of hurst_exponent according to the method selected. |
References
RS: Hurst, H. E. (1951). Long term storage capacity of reservoirs. ASCE
Transactions, 116(776), 770-808.
DMA: Alessio, E., Carbone, A., Castelli, G. et al. Eur. Phys. J. B (2002)
27: 197. http://dx.doi.org/10.1140/epjb/e20020150
DSOD: Istas, J.; G. Lang (1994), “Quadratic variations and estimation of
the local Hölder index of data Gaussian process,” Ann. Inst. Poincaré,
33, pp. 407–436.
Notes
The hurst exponent is an estimation which is important because there is no
data closed equation for it instead we have some methods to estimate it with
high variations among them.
See Also
hurst_rs, hurst_dma, hurst_dsod
Source code in ceruleo/transformation/features/hurst.py
hurst_rs(x, min_chunksize, max_chunksize, num_chunksize, out)
Estimate the Hurst exponent using R/S method.
Estimates the Hurst (H) exponent using the R/S method from the time series.
The R/S method consists of dividing the series into pieces of equal size
series_len and calculating the rescaled range. This repeats the process
for several series_len
values and adjusts data regression to obtain the H.
series_len
will take values between min_chunksize
and max_chunksize
,
the step size from min_chunksize
to max_chunksize
can be controlled
through the parameter step_chunksize
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x |
array
|
A time series to calculate hurst exponent, must have more elements than |
required |
min_chunksize |
int
|
This parameter allow you control the minimum window size. |
required |
max_chunksize |
int
|
This parameter allow you control the maximum window size. |
required |
num_chunksize |
int
|
This parameter allow you control the size of the step from minimum to maximum window size. Bigger step means fewer calculations. |
required |
out |
array
|
One element array to store the output. |
required |
Returns:
Type | Description |
---|---|
float
|
Estimation of Hurst exponent. |
References
Hurst, H. E. (1951). Long term storage capacity of reservoirs. ASCE
Transactions, 116(776), 770-808.
Alessio, E., Carbone, A., Castelli, G. et al. Eur. Phys. J. B (2002) 27:
197. http://dx.doi.org/10.1140/epjb/e20020150