White noise tests
whiteNoiseTest.RdWhite noise tests.
Arguments
- object
an object, such as sample autocorrelations or partial autocorrelations.
- h0
the null hypothesis, currently "iid" or "garch".
- ...
additional arguments passed on to methods.
Details
whiteNoiseTest carries out tests for white noise. The null
hypothesis is identified by argument h0, based on which
whiteNoiseTest chooses a suitable function to call. The
functions implementing the tests are also available to be called
directly and their documentation should be consulted for further
arguments that are available.
If h0 = "iid", the test statistics and rejection regions can be
use to test if the underlying time series is iid. Argument
method specifies the method for portmanteau tests: one of
"LiMcLeod" (default), "LjungBox", "BoxPierce".
If h0 = "garch", the null hypothesis is that the time series is
GARCH, see Francq & Zakoian (2010). The
tests in this case are based on a non-parametric estimate of the
asymptotic covariance matrix.
Portmonteau statistics and p-values are computed for the lags
specified by argument nlags. If it is missing, suitable lags
are chosen automatically.
If argument interval is TRUE, confidence intervals for the
individual autocorrelations or partial autocorrelations are computed.
References
Francq C, Zakoian J (2010). GARCH models: structure, statistical inference and financial applications. John Wiley & Sons. ISBN 978-0-470-68391-0.
Li WK (2004). Diagnostic checks in time series. Chapman & Hall/CRC Press.
See also
acfGarchTest (h0 = "garch"),
acfIidTest (h0 = "iid");
Examples
n <- 5000
x <- sarima:::rgarch1p1(n, alpha = 0.3, beta = 0.55, omega = 1, n.skip = 100)
x.acf <- autocorrelations(x)
x.pacf <- partialAutocorrelations(x)
x.iid <- whiteNoiseTest(x.acf, h0 = "iid", nlags = c(5,10,20), x = x, method = "LiMcLeod")
x.iid
#> $test
#> ChiSq DF pvalue
#> [1,] 1.142892 5 0.9502373
#> [2,] 6.425240 10 0.7783615
#> [3,] 19.813720 20 0.4696354
#> attr(,"method")
#> [1] "LiMcLeod"
#>
#> $ci
#> int
#> [1,] -0.02771808 0.02771808
#> [2,] -0.02771808 0.02771808
#> [3,] -0.02771808 0.02771808
#> [4,] -0.02771808 0.02771808
#> [5,] -0.02771808 0.02771808
#> [6,] -0.02771808 0.02771808
#> [7,] -0.02771808 0.02771808
#> [8,] -0.02771808 0.02771808
#> [9,] -0.02771808 0.02771808
#> [10,] -0.02771808 0.02771808
#> [11,] -0.02771808 0.02771808
#> [12,] -0.02771808 0.02771808
#> [13,] -0.02771808 0.02771808
#> [14,] -0.02771808 0.02771808
#> [15,] -0.02771808 0.02771808
#> [16,] -0.02771808 0.02771808
#> [17,] -0.02771808 0.02771808
#> [18,] -0.02771808 0.02771808
#> [19,] -0.02771808 0.02771808
#> [20,] -0.02771808 0.02771808
#> attr(,"level")
#> [1] 0.95
#>
x.iid2 <- whiteNoiseTest(x.acf, h0 = "iid", nlags = c(5,10,20), x = x, method = "LjungBox")
x.iid2
#> $test
#> ChiSq DF pvalue
#> [1,] 1.140803 5 0.9504289
#> [2,] 6.424512 10 0.7784265
#> [3,] 19.832409 20 0.4684563
#> attr(,"method")
#> [1] "LjungBox"
#>
#> $ci
#> int
#> [1,] -0.02771808 0.02771808
#> [2,] -0.02771808 0.02771808
#> [3,] -0.02771808 0.02771808
#> [4,] -0.02771808 0.02771808
#> [5,] -0.02771808 0.02771808
#> [6,] -0.02771808 0.02771808
#> [7,] -0.02771808 0.02771808
#> [8,] -0.02771808 0.02771808
#> [9,] -0.02771808 0.02771808
#> [10,] -0.02771808 0.02771808
#> [11,] -0.02771808 0.02771808
#> [12,] -0.02771808 0.02771808
#> [13,] -0.02771808 0.02771808
#> [14,] -0.02771808 0.02771808
#> [15,] -0.02771808 0.02771808
#> [16,] -0.02771808 0.02771808
#> [17,] -0.02771808 0.02771808
#> [18,] -0.02771808 0.02771808
#> [19,] -0.02771808 0.02771808
#> [20,] -0.02771808 0.02771808
#> attr(,"level")
#> [1] 0.95
#>
x.garch <- whiteNoiseTest(x.acf, h0 = "garch", nlags = c(5,10,20), x = x)
x.garch
#> $test
#> h Q pval
#> [1,] 5 0.5452572 0.9903723
#> [2,] 10 4.7304542 0.9084415
#> [3,] 20 17.2858687 0.6343406
#>
#> $ci
#> int
#> [1,] -0.04316442 0.04316442
#> [2,] -0.04180554 0.04180554
#> [3,] -0.03876060 0.03876060
#> [4,] -0.03604820 0.03604820
#> [5,] -0.03508113 0.03508113
#> [6,] -0.03319458 0.03319458
#> [7,] -0.03167507 0.03167507
#> [8,] -0.03151315 0.03151315
#> [9,] -0.03082342 0.03082342
#> [10,] -0.03031157 0.03031157
#> [11,] -0.03010730 0.03010730
#> [12,] -0.02881384 0.02881384
#> [13,] -0.02767999 0.02767999
#> [14,] -0.02809412 0.02809412
#> [15,] -0.02776439 0.02776439
#> [16,] -0.02827813 0.02827813
#> [17,] -0.02735102 0.02735102
#> [18,] -0.02801310 0.02801310
#> [19,] -0.02805033 0.02805033
#> [20,] -0.02855553 0.02855553
#>