| Library: | times |
| See also: | fracbrown lo kpss |
| Quantlet: | hurst | |
| Description: | estimates the Hurst coefficient of a stochastic process using the R/S statistic. |
| Usage: | {ra,b,q}=hurst(x,k) | |
| Input: | ||
| x | n x 1 vector, observations of the process | |
| k | scalar, maximal number of intervals for the R/S statistic | |
| Output: | ||
| ra | (k-2) x 3 matrix, ra[,1] = (1, ... ,1)', ra[,2] = log(n/3, n/4, ... ,n/k)', ra[,3] = log(RS) | |
| b | 2 x 1 vector, b[1] = intercept of the R/S-line, b[2] = slope of R/S line, b solves the regression problem ra[,3] = b[1] + b[2]*ra[,2]. The estimator for the Hurst coefficient is b[2]. | |
| q | scalar, variance of the residuals of the regression problem | |
library("times") // load library times
randomize(23)
x=cumsum(normal(500)) // simulate a Brownian motion(H = 0.5)
h=hurst(x,50)
h.b[2] // estimate H
Contents of _tmp [1,] 0.54921