R Documentation Function to calculate the Hurst exponent Description: Calculates the Hurst exponent of a numeric vector or multiple sliding windows selected from such vector Usage: Expoente_de_Hurst(vector, janela, incremento) Arguments: Vector: a numeric vector of any length Janela: size of the sliding window to be analyzed. If omitted, function will return the Hurst exponent for the entire vector. Incremento: distance from the first element of one window to the first element of the next window. If the parameter "janela" is provided, the parameter "incremento" must also be provided. If "janela" is ommited, "incremento" may shall also be omitted. Details: The function will return the Hurst exponent for each slinding window, or for the entire vector. The Hurst exponent is a measurement of autocorrelation of a time series and is directly related to its fractal dimension. The relationship between the Hurst exponent and the fractal dimension is given by Fractal Dimension = 2 - Hurst (as initially calculated by Benoît Mandelbrot). The first graph produced by the fuction helps to ilustrate this relationship (please see examples below). Since the Hurst exponent calculated for parts of the vector may differ a lot from the Hurst exponent calculated for the entire vector, it is important to note the difference in the autocorrelation within the time series (as given by the Hurst exponent). When the length of the window is equal to the length of the vector, or is not provided, the function will return the Hurst exponent calculated for the entire vector. Value: Expoente_de_Hurst(x) returns a dataframe with the following components: comp1 : Janelas, first column, is the number (from 1 to n) attributed to each observed window. comp2 : Expoente, second column, is the calculated Hurst exponent for each sliding window. When janela equals the length of the vector, the Hurst exponent for the entire vector will be returned. The function will also return two graphs: - the first will provide the Hurst exponent of the entire vector (in the upper left side of the plot), and the log of the number of elements (axis x) by the log of the Range divided by the standard deviation (axis y). This information is particularly interesting to analyze the fractal dimension of the vector. The linear regression of the two variables is also included. - the second will provide the variation of the Hurst exponent within the sliding windows analyzed, so that subsets of the original vector can be inspected separately. Warning If the object defined as "vector" is not numeric, the following error message will be given "Error in x[1] - h[j] : non-numeric argument to binary operator" Author(s): Created by Sergio Rhein Schirato 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. See Also: fractal::hurstSpec, RoverS, hurstBlock; fArma::LrdModelling, and hurstexp Examples: vector <- runif(1000, 0, 1) Expoente_de_Hurst(vector, 50, 50) vector <- seq(1:1000) Expoente_de_Hurst(vector, 100, 100) vector <- rep(1:2, 500) Expoente_de_Hurst(vector, 20, 20)