Portmanteau Test for Serial Correlation
pm_test.Rd
Test whether the residuals of an estimated model are serially correlated. The test statistic is $$Q = N^2\sum_{k=1}^{K} (N-k)^{-1}\mbox{tr} (G_k G_0^{-1} G_k' G_0^{-1})$$ where \(G_k\) are the sample covariances of the residuals. Under the Null of a correctly specified and estimated model the test statistic is asmyptotically Chi-squared distributed with \(Km^2-\kappa\) degrees of freedom, where \(\kappa\) is the number of (free) parameters of the model (class).
Arguments
- u
(N-by-m) matrix of residuals (or an object which may be coerced to a matrix with
as.matrix(u)
).- lag.max
(integer) maximum number of lags.
- n.par
(integer) number of parameters of the estimated model.