# hurst: Hurst Exponent In pracma: Practical Numerical Math Functions

## Description

Calculates the Hurst exponent using R/S analysis.

## Usage

 `1` ``` hurstexp(x, d = 50, display = TRUE) ```

## Arguments

 `x` a time series. `d` smallest box size; default 50. `display` logical; shall the results be printed to the console?

## Details

`hurstexp(x)` calculates the Hurst exponent of a time series `x` using R/S analysis, after Hurst, with slightly different approaches, or corrects it with small sample bias, see for example Weron.

These approaches are a corrected R/S method, an empirical and corrected empirical method, and a try at a theoretical Hurst exponent. It should be mentioned that the results are sometimes very different, so providing error estimates will be highly questionable.

Optimal sample sizes are automatically computed with a length that possesses the most divisors among series shorter than `x` by no more than 1 percent.

## Value

`hurstexp(x)` returns a list with the following components:

• `Hs` - simplified R over S approach

• `Hrs` - corrected R over S Hurst exponent

• `He` - empirical Hurst exponent

• `Hal` - corrected empirical Hurst exponent

• `Ht` - theoretical Hurst exponent

## Note

Derived from Matlab code of R. Weron, published on Matlab Central.

## References

H.E. Hurst (1951) Long-term storage capacity of reservoirs, Transactions of the American Society of Civil Engineers 116, 770-808.

R. Weron (2002) Estimating long range dependence: finite sample properties and confidence intervals, Physica A 312, 285-299.

`fractal::hurstSpec, RoverS, hurstBlock` and `fArma::LrdModelling`

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58``` ```## Computing the Hurst exponent data(brown72) x72 <- brown72 # H = 0.72 xgn <- rnorm(1024) # H = 0.50 xlm <- numeric(1024); xlm[1] <- 0.1 # H = 0.43 for (i in 2:1024) xlm[i] <- 4 * xlm[i-1] * (1 - xlm[i-1]) hurstexp(brown72, d = 128) # 0.72 # Simple R/S Hurst estimation: 0.6590931 # Corrected R over S Hurst exponent: 0.7384611 # Empirical Hurst exponent: 0.7068613 # Corrected empirical Hurst exponent: 0.6838251 # Theoretical Hurst exponent: 0.5294909 hurstexp(xgn) # 0.50 # Simple R/S Hurst estimation: 0.5518143 # Corrected R over S Hurst exponent: 0.5982146 # Empirical Hurst exponent: 0.6104621 # Corrected empirical Hurst exponent: 0.5690305 # Theoretical Hurst exponent: 0.5368124 hurstexp(xlm) # 0.43 # Simple R/S Hurst estimation: 0.4825898 # Corrected R over S Hurst exponent: 0.5067766 # Empirical Hurst exponent: 0.4869625 # Corrected empirical Hurst exponent: 0.4485892 # Theoretical Hurst exponent: 0.5368124 ## Compare with other implementations ## Not run: library(fractal) x <- x72 hurstSpec(x) # 0.776 # 0.720 RoverS(x) # 0.717 hurstBlock(x, method="aggAbs") # 0.648 hurstBlock(x, method="aggVar") # 0.613 hurstBlock(x, method="diffvar") # 0.714 hurstBlock(x, method="higuchi") # 1.001 x <- xgn hurstSpec(x) # 0.538 # 0.500 RoverS(x) # 0.663 hurstBlock(x, method="aggAbs") # 0.463 hurstBlock(x, method="aggVar") # 0.430 hurstBlock(x, method="diffvar") # 0.471 hurstBlock(x, method="higuchi") # 0.574 x <- xlm hurstSpec(x) # 0.478 # 0.430 RoverS(x) # 0.622 hurstBlock(x, method="aggAbs") # 0.316 hurstBlock(x, method="aggVar") # 0.279 hurstBlock(x, method="diffvar") # 0.547 hurstBlock(x, method="higuchi") # 0.998 ## End(Not run) ```

### Example output

```Simple R/S Hurst estimation:         0.6628842
Corrected R over S Hurst exponent:   0.7378703
Empirical Hurst exponent:            0.7921466
Corrected empirical Hurst exponent:  0.7675798
Theoretical Hurst exponent:          0.5268448
Simple R/S Hurst estimation:         0.5114482
Corrected R over S Hurst exponent:   0.539268
Empirical Hurst exponent:            0.5551066
Corrected empirical Hurst exponent:  0.5159487
Theoretical Hurst exponent:          0.5404756
Simple R/S Hurst estimation:         0.4762169
Corrected R over S Hurst exponent:   0.4722421
Empirical Hurst exponent:            0.4872281
Corrected empirical Hurst exponent:  0.4460807
Theoretical Hurst exponent:          0.5404756

Attaching package: 'splus2R'

The following object is masked from 'package:pracma':

peaks

Hurst coefficient via regression of nonparametric sdf estimate for x
--------------------------------------------------------------------
H estimate       : 0.7761436
Domain           : Frequency
Statistic        : SDF
Length of series : 1024

Spectral Density Function estimation for x
------------------------------------------
Length of series          : 1024
Sampling interval         : 1
Frequency resolution (Hz) : 0.0009765625
Centered                  : TRUE
Recentered                : FALSE
Single-sided              : TRUE
Method                    : Direct
Taper: rectangle
Number of points: 1024
Number of tapers: 1
Normalized: TRUE
X
0.7165741
Hurst coefficient via aggregated series for <S4 object of class structure("signalSeries", package = "splus2R")>
---------------------------------------------------------------------------------------------------------------
H estimate             : 0.6480954
Domain                 : Time
Statistic              : aggabs
Length of series       : 1024
Block overlap fraction : 0
Scale ratio            : 2

Scale  8.0000 16.0000 32.0000 64.0000 128.00000 256.00000 512.0
aggabs 1.2731  1.0621  0.8127  0.6022   0.46634   0.40302   0.3
Hurst coefficient via aggregated series for <S4 object of class structure("signalSeries", package = "splus2R")>
---------------------------------------------------------------------------------------------------------------
H estimate             : 0.6132652
Domain                 : Time
Statistic              : aggvar
Length of series       : 1024
Block overlap fraction : 0
Scale ratio            : 2

Scale  8.0000 16.0000 32.0000 64.00000 128.000 256.00000 512.000000
aggvar 2.5604  1.6799  1.1077  0.57757   0.398   0.23385   0.089998
Hurst coefficient via aggregated series for <S4 object of class structure("signalSeries", package = "splus2R")>
---------------------------------------------------------------------------------------------------------------
H estimate             : 0.7137823
Domain                 : Time
Statistic              : diffvar
Length of series       : 1024
Block overlap fraction : 0
Scale ratio            : 2

Scale   8.00000 16.00000 32.00000 64.00000 128.00000 256.00000
diffvar 0.88048  0.57226  0.53008  0.17957   0.16416   0.14385
Hurst coefficient via aggregated series for <S4 object of class structure("signalSeries", package = "splus2R")>
---------------------------------------------------------------------------------------------------------------
H estimate             : 1.001188
Domain                 : Time
Statistic              : higuchi
Length of series       : 1024
Block overlap fraction : 0
Scale ratio            : 2

Scale      8.0   16.0   32.0  64.00 128.00 256.00 512.000
higuchi 5097.3 2548.5 1274.5 637.74 319.03 159.69  80.091
Hurst coefficient via regression of nonparametric sdf estimate for x
--------------------------------------------------------------------
H estimate       : 0.4887491
Domain           : Frequency
Statistic        : SDF
Length of series : 1024

Spectral Density Function estimation for x
------------------------------------------
Length of series          : 1024
Sampling interval         : 1
Frequency resolution (Hz) : 0.0009765625
Centered                  : TRUE
Recentered                : FALSE
Single-sided              : TRUE
Method                    : Direct
Taper: rectangle
Number of points: 1024
Number of tapers: 1
Normalized: TRUE
X
0.6501847
Hurst coefficient via aggregated series for <S4 object of class structure("signalSeries", package = "splus2R")>
---------------------------------------------------------------------------------------------------------------
H estimate             : 0.3740671
Domain                 : Time
Statistic              : aggabs
Length of series       : 1024
Block overlap fraction : 0
Scale ratio            : 2

Scale  8.0000 16.00000 32.00000 64.00000 128.000000 256.000000 512.000000
aggabs 0.3065  0.21453  0.17895  0.13988   0.065103   0.050735   0.019571
Hurst coefficient via aggregated series for <S4 object of class structure("signalSeries", package = "splus2R")>
---------------------------------------------------------------------------------------------------------------
H estimate             : 0.3365877
Domain                 : Time
Statistic              : aggvar
Length of series       : 1024
Block overlap fraction : 0
Scale ratio            : 2

Scale  8.00000 16.000000 32.000000 64.000000 1.2800e+02 2.5600e+02 5.1200e+02
aggvar 0.13643  0.069684  0.044683  0.024735 7.3274e-03 2.9607e-03 3.8304e-04
Hurst coefficient via aggregated series for <S4 object of class structure("signalSeries", package = "splus2R")>
---------------------------------------------------------------------------------------------------------------
H estimate             : 0.5539877
Domain                 : Time
Statistic              : diffvar
Length of series       : 1024
Block overlap fraction : 0
Scale ratio            : 2

Scale   8.000000 16.000000 32.000000 64.000000 1.2800e+02 2.5600e+02
diffvar 0.066742  0.025001  0.019948  0.017408 4.3666e-03 2.5777e-03
Hurst coefficient via aggregated series for <S4 object of class structure("signalSeries", package = "splus2R")>
---------------------------------------------------------------------------------------------------------------
H estimate             : 0.5704695
Domain                 : Time
Statistic              : higuchi
Length of series       : 1024
Block overlap fraction : 0
Scale ratio            : 2

Scale    8.000 16.000 32.0000 64.0000 128.0000 256.00000 512.00000
higuchi 39.271 14.758  5.4405  1.9344   0.6031   0.25144   0.11888
Hurst coefficient via regression of nonparametric sdf estimate for x
--------------------------------------------------------------------
H estimate       : 0.4775023
Domain           : Frequency
Statistic        : SDF
Length of series : 1024

Spectral Density Function estimation for x
------------------------------------------
Length of series          : 1024
Sampling interval         : 1
Frequency resolution (Hz) : 0.0009765625
Centered                  : TRUE
Recentered                : FALSE
Single-sided              : TRUE
Method                    : Direct
Taper: rectangle
Number of points: 1024
Number of tapers: 1
Normalized: TRUE
X
0.622098
Hurst coefficient via aggregated series for <S4 object of class structure("signalSeries", package = "splus2R")>
---------------------------------------------------------------------------------------------------------------
H estimate             : 0.3157772
Domain                 : Time
Statistic              : aggabs
Length of series       : 1024
Block overlap fraction : 0
Scale ratio            : 2

Scale  8.000000 16.000000 32.000000 64.000000 128.000000 256.000000 5.1200e+02
aggabs 0.090178  0.067695  0.044709  0.029975   0.027719   0.016845 3.1962e-03
Hurst coefficient via aggregated series for <S4 object of class structure("signalSeries", package = "splus2R")>
---------------------------------------------------------------------------------------------------------------
H estimate             : 0.2790303
Domain                 : Time
Statistic              : aggvar
Length of series       : 1024
Block overlap fraction : 0
Scale ratio            : 2

Scale  8.000000 16.0000000 32.0000000 64.0000000 1.2800e+02 2.5600e+02
aggvar 0.013217  0.0065376  0.0029642  0.0011352 8.4664e-04 4.7688e-04

Scale  5.1200e+02
aggvar 1.0215e-05
Hurst coefficient via aggregated series for <S4 object of class structure("signalSeries", package = "splus2R")>
---------------------------------------------------------------------------------------------------------------
H estimate             : 0.5474477
Domain                 : Time
Statistic              : diffvar
Length of series       : 1024
Block overlap fraction : 0
Scale ratio            : 2

Scale   8.0000000 16.0000000 32.000000 6.4000e+01 1.2800e+02 2.5600e+02
diffvar 0.0066798  0.0035734  0.001829 2.8857e-04 3.6976e-04 4.6667e-04
Hurst coefficient via aggregated series for <S4 object of class structure("signalSeries", package = "splus2R")>
---------------------------------------------------------------------------------------------------------------
H estimate             : 0.9983184
Domain                 : Time
Statistic              : higuchi
Length of series       : 1024
Block overlap fraction : 0
Scale ratio            : 2

Scale    8.000 16.000 32.000 64.0000 128.0000 256.0000 512.0000
higuchi 65.638 32.766 16.389  8.1908   4.0982   2.0423   1.0162
```

pracma documentation built on Jan. 30, 2018, 3:01 a.m.