powered by
It reads a vector representing a time series, applies acf for a given number of lags
acf
acfToDf( x = NULL, lag.max = 100, length.out = 10 )
numeric vector. Must represent a variable sampled at regular times.
integer, number of lags over which to compute temporal autocorrelation.
integer, total number of lags to consider for plotting. Should be a subset of lag.max.
lag.max
A dataframe with the columns: #'
lag: numeric, lag in the time units of x with a maximum determined by lag.max, and a number of unique values determined by length.out
x
length.out
acf: Pearson correlation index returned by the acf for a given number of lags for the given lag.
ci.max: Maximum value of the confidence interval of acf.
ci.min: Minimum value of the confidence interval of acf.
This function computes temporal autocorrelation of a given vector using acf, and returns a dataframe ready for easy plotting with plotAcf.
plotAcf
acf, plotAcf
# NOT RUN { #getting a driver data(driverA) #computing temporal autocorrelations x.df <- acfToDf( x = driverA, lag.max = 1000, length.out = 100 ) str(x.df) #plotting output plotAcf(x.df) # }
Run the code above in your browser using DataLab