I would like to calculate the Hurst exponent with R. Is there a library or built-in function that can do this? any suggestion will be appreciated (even links to links). thanks
update: thanx in Ben Bolker comment, I found this script in a function example
hurst.est(wspec, range, nvoice, plot=TRUE)
on this page http://finzi.psych.upenn.edu/R/library/Rwave/html/hurst.est.html
script:
wnoise <- rnorm(8192) plot.ts(wnoise) spwnoise <- fft(wnoise) spwnoise <- Mod(spwnoise) spwnoise <- spwnoise*spwnoise plot(spwnoise[1:4096], log="xy", type="l") lswnoise <- lsfit(log10(1:4096), log10(spwnoise[1:4096])) abline(lswnoise$coef) cwtwnoise <- DOG(wnoise, 10, 5, 1, plot=FALSE) mcwtwnoise <- Mod(cwtwnoise) mcwtwnoise <- mcwtwnoise*mcwtwnoise wspwnoise <- tfmean(mcwtwnoise, plot=FALSE) wspec.pl(wspwnoise, 5) hurst.est(wspwnoise, 1:50, 5)
I assume that the first part generates a signal with a memory effect, but I canโt understand which part of the second part of the code is strictly necessary to refresh the hurst metric. Who can help me and explain it? I doubt
mcwtwnoise <- Mod(cwtwnoise) mcwtwnoise <- mcwtwnoise*mcwtwnoise
r time-series
emanuele
source share