diag_ljung_box: Ljung-Box Test for Serial Correlation

Description Usage Arguments Value Details References See Also Examples

Description

The Ljung-Box Test for serial correlation.

Usage

1
diag_ljung_box(x, lags = c(8, 10, 12), order = 0, squared = FALSE)

Arguments

x

A matrix / data.frame / numeric vector of (multivariate) financial time series. Each column contains a series, each row an observation of the series.

lags

The number of lags of cross-correlation matrices used in the tests. Can take multiple values. Defaults to lags = c(8, 10, 12).

order

If the test is performed on residuals of a fitted time series model such as (V)ARMA or GARCH order generally equals the count of coefficients from the fitted model. Defaults to order = 0.

squared

Logical switch, if the squared series should be tested. Defaults to squared = FALSE.

Value

The Ljung-Box Test statistic, it's p-value and further parameters as a data.frame.

Details

The univariate Ljung-Box (1978) Test is denoted by

Q*(m) = T * (T + 2) * ∑^m_i=1 * ρ²_i / (T - i)

where T stands for the sample size and ρ_i for the lag-i sample autocorrelation of e_t.

The Hypothesis H0 : ρ_1 = ... = ρ_m = 0 is tested against H1 : ρ_i != 0 for i = (1 ≤ i ≤ m). Under the null hypothesis of no conditional heteroscedasticity in a_t, the test statistic Q*(m) is asymptotically distributed as χ²_m.

The generalization of the Ljung-Box Test to the multivariate case, see e.g. Hosking (1980, 1981) is denoted by

Q*_k(m) = T² * ∑_{i=1}^m * (1 / (T - i)) * b'_i(ρ_0^-1 \otimes ρ_0^-1) * b_i

where T stands for the sample size, k for the dimension of a_t and b_i = vec(ρ'_i) with ρ_j being the lag-ρ_j cross-correlation matrix of a²_t. As in the univariate case, under the null hypothesis of no conditional heteroscedasticity in a_t, Q*_k(m) is asymptotically distributed as χ²_{k²m}.

References

Ljung, G. & Box, G. E. P (1978). On a measure of lack of fit in time series models. Biometrika 66: 67-72.

Hosking, J. R. M. (1980). The multivariate portmanteau statistic. Journal of the American Statistical Association, 75: 602–607.

Hosking, J. R. M. (1981). Lagrange-multiplier tests of multivariate time series model. Journal of the Royal Statistical Society, Series B, 43: 219–230.

Li, W. K. (2004). Diagnostic Checks in Time Series. Chapman & Hall / CRC. Boca Raton, FL.

Mahdi, E. & McLeod, A. I. (2012). Improved multivariate portmanteau diagnostic test. Journal of Time Series Analysis 33/2, 211-222.

Tsay, R. S. (2014). multivariate Time Series Analysis with R and Financial Applications. John Wiley. Hoboken, NJ.

Tsay, R. S. (2015). MTS: All-Purpose Toolkit for Analyzing multivariate Time Series (MTS) and Estimating multivariate Volatility Models. R package version 0.33.

See Also

diag_std_et for the transformation of a multivariate financial time series to a standardized scalar series which can be tested for conditional heteroscedasticity (ARCH effect) with the Ljung-Box Test, mv_ch_tests for different varieties of ARCH tests, diag_std_et_cnd for the transformation of a multivariate financial time series to a standardized scalar series and a multivariate (marginally) standardized series based on fitted conditional covariance matrices.

Examples

1
2
3
4
5
6
7
# create heteroscedastic data
dat <- mgarchBEKK::simulateBEKK(3, 500)
eps <- data.frame(eps1 = dat$eps[[1]], eps2 = dat$eps[[2]],
                  eps3 = dat$eps[[3]])

# perform multivariate arch test
diag_ljung_box(eps)

sebinum/baqgarchutil documentation built on May 8, 2019, 11:58 p.m.