tests whether the data is autocorrelated.


tests whether the data is autocorrelated up to lag k.


returns the value of "property" for a given model.

Details and Options

  • AutocorrelationTest performs a hypothesis test for randomness on data with the null hypothesis that the autocorrelations ρ1=ρ2==ρk==0 and alternative that at least one of the ρi0.
  • Rejecting the null hypothesis allows the conclusion that the data is not random.
  • By default, a probability value or -value is returned.
  • A small -value suggests that randomness is unlikely.
  • The data can be a list of values {x1,x2,,xn} or a TemporalData object.
  • The lag k can be Automatic or a positive integer such that k<n.
  • If k is not given, it is taken to be Automatic.
  • Setting k to Automatic gives k=Ceiling[Log[n]]].
  • AutocorrelationTest[data,k,"test"] reports the -value according to "test".
  • The following tests can be used for univariate data with all paths of equal length n:
  • "LjungBox"
  • For multivariate data:
  • "LjungBox"
    "BoxPierce"n sum_(i=1)^kTr[TemplateBox[{{(, {gamma, _, i}, )}}, Transpose].TemplateBox[{{(, {gamma, _, 0}, )}}, Inverse].gamma_i.TemplateBox[{{(, {gamma, _, 0}, )}}, Inverse]]
  • AutocorrelationTest[data,k,"HypothesisTestData"] returns a HypothesisTestData object htd that can be used to extract additional test results and properties using the form htd["property"].
  • AutocorrelationTest[data,k,"property"] can be used to directly give the value of "property".
  • Properties related to the reporting of test results include:
  • "AllTests"list of all applicable tests
    "AutomaticTest"test chosen if Automatic is used
    "PValue"list of -values
    "PValueTable"formatted table of -values
    "ShortTestConclusion"a short description of the conclusion of a test
    "TestConclusion"a description of the conclusion of a test
    "TestData"list of pairs of test statistics and -values
    "TestDataTable"formatted table of -values and test statistics
    "TestStatistic"list of test statistics
    "TestStatisticTable"formatted table of test statistics
  • The following option can be used:
  • SignificanceLevel0.05cutoff for diagnostics and reporting
  • For unit root tests, a cutoff is chosen such that is rejected only if . The value of used for the "TestConclusion" and "ShortTestConclusion" properties is controlled by the SignificanceLevel option. By default, is set to 0.05.


open all close all

Basic Examples  (1)

Test whether data is random:

Click for copyable input
Click for copyable input

The data is autocorrelated:

Click for copyable input

Scope  (14)

Options  (1)

Applications  (2)

Possible Issues  (1)

Introduced in 2014