本科时候做ARIMA模型的时候就发现Q-statistic of residual和resid的序列相关检验出来的Q统计量不一样,很纠结,今日再做, 不想把这个问题再放下去,所以查资料解决之。既然说到这问题,那我从头说起:
什么是Q统计量检验:The Ljung–Box test test can be defined as follows.
H0: The data are independently distributed (i.e. the correlations in the population from which the sample is taken are 0, so that any observed correlations in the data result from randomness of the sampling process).Ha: The data are not independently distributed.The test statistic is:
统计量where n is the sample size, is the sample autocorrelation at lag k, and h is the number of lags being tested. For significance level α, the critical region for rejection of the hypothesis of randomness is \chi_{1-\alpha,h}^2
" src="http://upload.wikimedia.org/math/f/9/3/f934e8fde5eb44af530d2e75c233cf92.png">
where is the α-quantile of the chi-squared distribution with h degrees of freedom.
The Ljung–Box test is commonly used in autoregressive integrated moving average (ARIMA) modeling. Note that it is applied to the residuals of a fitted ARIMA model, not the original series, and in such applications the hypothesis actually being tested is that the residuals from the ARIMA model have no autocorrelation. When testing ARIMA models, no adjustment to the test statistic or to the critical region of the test are made in relation to the structure of the ARIMA model. http://en.wikipedia.org/wiki/Ljung-Box_test
上面这一段来自维基百科,解释了两个问题: