auto_corr | R Documentation |
This function calculates the autocorrelation for a given time series data. It estimates the autocorrelation coefficients, standard errors, test statistics, and p-values for each lag up to a specified maximum lag.
auto_corr(x, lag, alpha = 0.05)
x |
A numeric vector representing the time series data. |
lag |
The maximum lag for which autocorrelation is to be calculated. |
alpha |
The significance level for hypothesis tests. Default is 0.05. |
A data frame containing the lag, autocorrelation coefficients (ar), standard errors (se), test statistics (statistic), p-values (p_z and p_t), overall standard errors (se_all), Ljung-Box test statistic (q_lb), and p-value for the Ljung-Box test (p_all).
Bartlett, M. S. (1946). On the theoretical specification and sampling properties of autocorrelated time-series. Supplement to the Journal of the Royal Statistical Society, 8(1), 27-41.
Ljung, G. M., & Box, G. E. P. (1978). On a measure of lack of fit in time series models. Biometrika, 65(2), 297-303.
https://de.wikipedia.org/wiki/Korrelogramm
http://sfb649.wiwi.hu-berlin.de/fedc_homepage/xplore/tutorials/xegbohtmlnode39.html
https://en.wikipedia.org/wiki/Ljung%E2%80%93Box_test
data <- c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
auto_corr(data, lag = 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.