Box.test.2 {caschrono}R Documentation

'Portemanteau' tests

Description

Box.test.2 computes at different lags, a 'Portemanteau' statistic for testing that a time series is a white noise.

Usage

Box.test.2(x, nlag, type = c("Box-Pierce", "Ljung-Box"), fitdf = 0, decim = 8)

Arguments

x

a time series object

nlag

a vector of integers: the lags where the statistic are computed

type

test to be performed

fitdf

number of degrees of freedom to be subtracted if x is a series of residuals

decim

an integer, the precision of the results

Details

This function uses the Box.test.

Value

It returns a matrix of size nlag x 2 with the statistics and the p-value

Author(s)

Yves Aragon

Examples

set.seed(123)
y1 = arima.sim(n = 100, list(ar = -.7), sd = sqrt(4))
a1 = Box.test.2(y1, nlag = c(3, 6, 9, 12), type = "Ljung-Box", decim = 4)

[Package caschrono version 2.2 Index]