# portmanteauTest.h: Portmanteau tests for one lag. In weakARMA: Tools for the Analysis of Weak ARMA Models

 portmanteauTest.h R Documentation

## Portmanteau tests for one lag.

### Description

Computes Box-Pierce and Ljung-Box statistics for standard, modified and self-normalized test procedures.

### Usage

portmanteauTest.h(ar = NULL, ma = NULL, y, h, grad = NULL)


### Arguments

 ar Vector of AR coefficients. If NULL, it is a MA process. ma Vector of MA coefficients. If NULL, it is an AR process. y Univariate time series. h Integer for the chosen lag. grad Gradient of the series from the function gradient. If NULL gradient will be computed.

### Details

Portmanteau statistics are generally used to test the null hypothesis. H0 : X_t satisfies an ARMA(p,q) representation.

The Box-Pierce (BP) and Ljung-Box (LB) statistics, defined as follows, are based on the residual empirical autocorrelation.

Q_{m}^{BP} = n∑_{h}^{m} ρ^{2}(h)

Q_{m}^{LB} = n(n+2) ∑_{h}^{m} \frac{ρ^{2}(h)}{(n-h)}

The standard test procedure consists in rejecting the null hypothesis of an ARMA(p,q) model if the statistic Q_m > χ^{2}(1-α) where χ^{2}(1-α) denotes the (1-α)-quantile of a chi-squared distribution with m-(p+q) (where m > p + q) degrees of freedom. The two statistics have the same asymptotic distribution, but the LB statistic has the reputation of doing better for small or medium sized samples.

But the significance limits of the residual autocorrelation can be very different for an ARMA models with iid noise and ARMA models with only uncorrelated noise but dependant. The standard test is obtained under the stronger assumption that ε_{t} is iid. So we give an another way to obtain the exact asymptotic distribution of the standard portmanteau statistics under the weak dependence assumptions.

Under H0, the statistics Q_{m}^{BP} and Q_{m}^{LB} converge in distribution as n \rightarrow ∞, to

Z_m(ξ_m) := ∑_{i}^{m}ξ_{i,m} Z^{2}_i

where ξ_m = (ξ_{1,m}',...,ξ_{m,m}') is the eigenvalues vector of the asymptotic covariance matrix of the residual autocorrelations vector and Z_{1},...,Z_{m} are independent \mathcal{N}(0,1) variables.

So when the error process is a weak white noise, the asymptotic distribution Q_{m}^{BP} and Q_{m}^{LB} statistics is a weighted sum of chi-squared. The distribution of the quadratic form Z_{m}(ξ_m) can be computed using the algorithm by Imhof available here : imhof

We propose an alternative method where we do not estimate an asymptotic covariance matrix. It is based on a self-normalization based approach to construct a new test-statistic which is asymptotically distribution-free under the null hypothesis.

The sample autocorrelation, at lag h take the form \hat{ρ}(h) = \frac{\hat{Γ}(h)}{\hat{Γ}(0)}. Where \hat{Γ}(h) = \frac{1}{n} ∑_{t=h+1}^n \hat{e}_t\hat{e}_{t-h}. With \hat{Γ}_m = (\hat{Γ}(1),...,\hat{Γ}(m)) The vector of the first m sample autocorrelations is written \hat{ρ}_m = (\hat{ρ}(1),...,\hat{ρ}(m))'.

The normalization matrix is defined by \hat{C}_{m} = \frac{1}{n^{2}}∑_{t=1}^{n} \hat{S}_t \hat{S}_t' where \hat{S}_t = ∑_{j=1}^{t} (\hat{Λ} \hat{U}_{j} - \hat{Γ}_m).

The sample autocorrelations satisfy Q_{m}^{SN}=n\hat{σ}^{4}\hat{ρ}_m ' \hat{C}_m^{-1}\hat{ρ}_m \rightarrow U_{m}.

\tilde{Q}_{m}^{SN} = n\hat{σ}^{4}\hat{ρ}_{m}' D_{n,m}^{1/2}\hat{C}_{m}^{-1} D_{n,m}^{1/2}\hat{ρ}_{m} \rightarrow U_{m} reprensating respectively the version modified of Box-Pierce (BP) and Ljung-Box (LB) statistics. Where D_{n,m} = ≤ft(\begin{array}{ccc} \frac{n}{n-1} & & 0 \\ & \ddots & \\ 0 & & \frac{n}{n-m} \end{array}\right). The critical values for U_{m} have been tabulated by Lobato.

### Value

A list including statistics and p-value:

Pm.BP

Standard portmanteau Box-Pierce statistics.

PvalBP

p-value corresponding at standard test where the asymptotic distribution is approximated by a chi-squared

PvalBP.Imhof

p-value corresponding at the exact asymptotic distribution of the standard portmanteau Box-Pierce statistics.

Pm.LB

Standard portmanteau Box-Pierce statistics.

PvalLB

p-value corresponding at standard test where the asymptotic distribution is approximated by a chi-squared.

PvalLB.Imhof

p-value corresponding at the exact asymptotic distribution of the standard portmanteau Ljung-Box statistics.

LB.modSN

Ljung-Box statistic with the self-normalization method.

BP.modSN

Box-Pierce statistic with the self-normalization method.

### References

Boubacar Maïnassara, Y. 2011, Multivariate portmanteau test for structural VARMA models with uncorrelated but non-independent error terms Journal of Statistical Planning and Inference, vol. 141, no. 8, pp. 2961-2975.

Boubacar Maïnassara, Y. and Saussereau, B. 2018, Diagnostic checking in multivariate ARMA models with dependent errors using normalized residual autocorrelations , Journal of the American Statistical Association, vol. 113, no. 524, pp. 1813-1827.

Francq, C., Roy, R. and Zakoïan, J.M. 2005, Diagnostic Checking in ARMA Models with Uncorrelated Errors, Journal of the American Statistical Association, vol. 100, no. 470 pp. 532-544

Lobato, I.N. 2001, Testing that a dependant process is uncorrelated. J. Amer. Statist. Assos. 96, vol. 455, pp. 1066-1076.

portmanteauTest to obtain the statistics of all m lags.