本文目的:1、做arima模型的时候你需要在模型拟合完之后做残差的Q统计量检验,但是你又不会看结果; 2、你会看结果,但是是否发现疑问:为什么直接在模型中选择残差检验中的Q统计量检验得出的结果与选择resid数据进行序列相关检验得出的结果天壤之别。 有这种疑问看下文: 本科时候做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 ![]() 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./wiki/Ljung-Box_test 上面这一段来自维基百科,解释了两个问题:
PS: 在我做arma的时候,总是Q统计量检验通不过,总是p很小,残差项相关,不管如何改阶数都不好解决,(应该有不少人遇到这个问题)今天尝试分析季节趋势,确实,p很小这种情况往往发生在日数据上,我今日在做的股价模型就是因为数据量很多,画出图来之后很难发现季节趋势,在加入5天的季节趋势之后Q检验很好的通过了,多次尝试之后SAR,SMA加入就很好的提高的残差信息表示量,模型就可以了。不过这只是一般题目,实际问题还需要继续讨论。 正在学习,欢迎高手指出错误共同交流。 |
|