Description Usage Arguments Details Value
Calculates either the cross-correlation function for two variables or the auto-correlation function for a single variable. It can be used to calculate values with bounded periodicity (i.e. the values wrap around'). It uses the population level standard deviation; as such, for self-repeating patterns the ACF does not decay over time.
1 |
x |
a vector of numeric values. |
y |
a vector of numeric values #optional input. |
lag.max |
the total number of lag times that cross-correlation or autocorrelation will be calculated for. |
wrap |
determines whether bounded periodicty should be used (wrap=T). Bounded periodicity means that the values 'wrap round'. Usually, not required. |
level |
determines whether correlation is calculated using the population-level correlation denominator of 'n' or the sample-level correlation demoninator of 'n-1'. Level only accepts values of 'population' or 'sample'. By default it is set to 'sample'. |
To autocorrelate a single variable, just pass x. To cross-correlate two variables, pass both x and y.
cor.out object is returned. There are nine variables that can be accessed: cor, lag, series, x, y, fit_best, wrap, type, level, conf.int.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.