天天看點

懿說學區(44) | SPSS統計分析(54)ARIMA模型

作者:LearningYard學苑

Yi Shuo School District (44) SPSS Statistical Analysis (54) ARIMA Model

懿說學區(44) | SPSS統計分析(54)ARIMA模型

【思維導圖】

懿說學區(44) | SPSS統計分析(54)ARIMA模型

【基本概念與統計原理】

在預測中,對于平穩的時間序列。可用自回歸移動平均模型及特殊情況的自回歸模型,移動平均模型等來拟合,預測該時間序列的未來值,但在實際的經濟預測中,随機資料序列往往都是非平穩的,此時就需要對該随機資料序列進行差分運算,進而得到ARMA模型的推廣——ARIMA模型。ARIMA模型全稱綜合自回歸移動平均模型簡記為ARIMA(p,d,q)模型,是由Box和JenKins于20世紀70年代初提出的著名時間序列預測模型,又稱為Box-JenKins模型,其中AR是自回歸,p為自回歸階數,MA為移動平均,q為移動平均階數,d為時間序列成為平穩時間序列時所做的差分次數。ARIMA(p,d,q)模型的實質就是差分運算與ARMA(p,q)模型的組合,即ARMA(p,q)模型經過d次差分後,便成為ARMA(p,d,q)。

The full name of ARIMA model is ARIMA (p, d, q) model, which is a famous time series prediction model put forward by Box and JenKins in the early 1970s, also known as Box-JenKins model, in which AR is autoregressive, p is autoregressive order, MA is moving average, q is moving average order, and d is the difference times when the time series becomes stationary time series. The essence of ARIMA (p, d, q) model is the combination of difference operation and ARMA (p, q) model, that is, ARMA (p, q) model becomes ARMA (p, d, q) after d times of difference.

【ARIMA模組化步驟】

ARIMA模組化實際上包括三個階段,即模型識别階段、參數估計和檢驗階段、預測應用階段。其中前兩個階段可能需要反複進行。

ARIMA modeling actually includes three stages, namely, model identification stage, parameter estimation and verification stage, and prediction application stage. The first two stages may need to be repeated.

ARIMA模型的識别就是判斷p,d,q,sp,sd,sq的階,主要依靠自相關函數(ACF)和偏自相關函數(PACF)圖來初步判斷和估計。一個識别良好的模型應該有兩個要素:一是模型的殘差為白噪聲序列,需要通過殘差白噪聲檢驗,二是模型參數的簡約性和拟合優度名額的優良性(如對數似然值較大,AIS和BIS較小)方面取得平衡,還有一點需要注意,模型的形式應該易于了解。

The recognition of ARIMA model is to judge the order of p, d, q, sp, sd and sq, which mainly depends on autocorrelation function (ACF) and partial autocorrelation function (PACF) graph to preliminarily judge and estimate. A well-recognized model should have two elements: one is that the residual of the model is a white noise sequence, which needs to pass the residual white noise test; the other is to strike a balance between the simplicity of model parameters and the excellence of goodness-of-fit indexes (such as large logarithmic likelihood value, small AIS and BIS); and it should be noted that the form of the model should be easy to understand.

【ARIMA執行個體分析】

下面我們來進行ARIMA的一則執行個體分析:

Let's analyze an example of ARIMA:

如下圖所示是某加油站55天的燃油剩餘資料,其中正值表示燃油有剩餘,負值表示燃油不足,要求對此序列拟合時間序列模型并進行分析。

The following figure shows the fuel surplus data of a gas station for 55 days, in which positive value indicates fuel surplus and negative value indicates fuel shortage. It is required to fit the time series model and analyze this series.

懿說學區(44) | SPSS統計分析(54)ARIMA模型

第一步,分析并組織資料。将資料組織成兩列,一列是“天數”,一列是“燃油量”,輸入資料并儲存,并以“天數”定義日期變量,會新增一個名為“DATE_”的變量。

The first step is to analyze and organize the data. Organize the data into two columns, one is "Days" and the other is "Fuel Quantity", enter the data and save it, and define the DATE variable with "Days", and a new variable named "DATE_" will be added.

懿說學區(44) | SPSS統計分析(54)ARIMA模型
懿說學區(44) | SPSS統計分析(54)ARIMA模型
懿說學區(44) | SPSS統計分析(54)ARIMA模型

第二步,觀察資料序列的性質。作序列圖,可以看出資料序列在0上下震蕩,且無規律,可能是平穩的時間序列。再做自相關圖和偏自相關圖進一步分析,綜合該序列自相關函數和偏自相關函數的性質,可以拟合模型為AR(1),即ARIMA(1,0,0)。

The second step is to observe the properties of the data sequence. By making a sequence diagram, we can see that the data sequence oscillates up and down at 0, which is irregular and may be a stationary time series. Then the autocorrelation graph and partial autocorrelation graph are further analyzed. By synthesizing the properties of the autocorrelation function and partial autocorrelation function of the sequence, the fitting model can be AR (1), that is, ARIMA (1, 0, 0).

懿說學區(44) | SPSS統計分析(54)ARIMA模型
懿說學區(44) | SPSS統計分析(54)ARIMA模型
懿說學區(44) | SPSS統計分析(54)ARIMA模型
懿說學區(44) | SPSS統計分析(54)ARIMA模型
懿說學區(44) | SPSS統計分析(54)ARIMA模型

第三步,模型拟合。根據下圖所示進行設定。

The third step is model fitting. Set as shown in the following figure.

懿說學區(44) | SPSS統計分析(54)ARIMA模型
懿說學區(44) | SPSS統計分析(54)ARIMA模型
懿說學區(44) | SPSS統計分析(54)ARIMA模型
懿說學區(44) | SPSS統計分析(54)ARIMA模型

第四步,主要結果及分析。從結果來看,拟合效果不大理想,決定系數的值偏小,而且從顯著性機率值大于0.05來看,楊-博克斯統計量的觀測值也不太理想。

The fourth step, the main results and analysis. From the results, the fitting effect is not ideal, the value of determination coefficient is small, and from the point of view that the significance probability value is greater than 0.05, the observed value of Yang-Bocks statistics is not ideal.

懿說學區(44) | SPSS統計分析(54)ARIMA模型
懿說學區(44) | SPSS統計分析(54)ARIMA模型

從結果中可以看出,AR(1)模型的參數為-0.382,參數是顯著的,常數項為4.69,不顯著,這裡仍然保留常數項。從結果來看,其拟合模型為Xt-0.382Xt-1=4.69+At。

It can be seen from the results that the parameter of AR (1) model is-0. 382, the parameter is significant, and the constant term is 4.69, which is not significant, and the constant term is still retained here. From the results, the fitting model is Xt-0. 382Xt-1=4. 69 + At.

懿說學區(44) | SPSS統計分析(54)ARIMA模型

從ARIMA(1,0,0)模型拟合殘差的自相關函數和偏自相關函數圖,可以看出,殘差的自相關和偏自相關函數都是0階截尾的,因而殘差是一個不含相關性的白噪聲序列。是以,序列的相關性都已經充分拟合了。

From ARIMA (1, 0, 0) model fitting the autocorrelation function and partial autocorrelation function diagram of residuals, we can see that the autocorrelation and partial autocorrelation function of residuals are 0-order truncated, so the residuals are a white noise sequence without correlation. Therefore, the correlation of sequences has been fully fitted.

懿說學區(44) | SPSS統計分析(54)ARIMA模型

下期預告:本期,我們學習了ARIMA模型的理論基礎和執行個體分析。下一期,我們将會學習 時間序列的季節性分解。

Forecast for the next issue: In this issue, we learned the theoretical basis and case analysis of ARIMA model. In the next issue, we will learn the seasonal decomposition of time series.

如果您對今天的文章有獨特的想法,歡迎給我們留言,讓我們相約明天,祝您今天過得開心快樂!

If you have a unique idea of today's article, welcome to leave us a message, let us meet tomorrow, I wish you a happy today!

參考資料:《SPSS23(中文版)統計分析實用教程》、百度百科

翻譯:訊飛語音

本文由learningyard新學苑原創,部分圖檔文字來源于他處。如有侵權,請聯系删除。

繼續閱讀