Lesson 15: Building ARMA models. Examples Dipartimento di Ingegneria e Scienze dell Informazione e Matematica Università dell Aquila, umberto.triacca@ec.univaq.it
Examples In this lesson, in order to illustrate the time series modelling methodology we have presented so far, we analyze some time series.
Example 1 By using a computer program we have generated a time series x.the graph of the series is presented in the following figure Figure : A simulated time series
Example 1 The objective is to build an ARMA model this time series. The first step in developing a model is to determine if the series is stationary.
Example 1 Figure : Sample autocorrelation and sample partial autocorrelation Our time series seems the realization of a stationary process with zero mean, thus we can look at sample autocorrelation and partial autocorrelation function to establish the orders p and q of the ARMA model.
Example 1 Since the SACF cuts off after lag 2 and the SPCAF follows a damped cycle, an MA(2) model x t = u t + θ 1 u t 1 + θ 2 u t 2, u t WN(0, σ 2 ) seems appropriate for the sample data.
Example 1 Table reports the result of the ML estimation. 300 observations, Dependent Variable x Variabile Coefficient St. error t statistic p-value θ 1 1,68559 0,0456203 36,9481 0,0000 θ 2 0,883683 0,0492842 17,9303 0,0000 Variance of innovations 0.941107
Example 1 Now, we consider the graph of the residuals Figure : Residuals from MA(2) model
Example 1 Figure : SACF and SPACF of residuals from MA(2) model
Example 1 By analysing the SACF and SPACF of residuals presented in figure, we note that any term isn t significant and Q 25 = 16.4450 do not indicate any autocorrelation in the residuals. They can be assimilate to a white noise process.
Example 1 We conclude that the MA(2) model defined by x t = u t + 1.686u t 1 + 0.884u t 2, u t WN(0, 0.94) appear to fit the data very well.
Example 2 Consider the montly series of the foreign exchange rate Lira per US Dollar from Jannuary 1973 until October 1989 (202 observations).
Example 2 It can be observed that the series displays a nonstationary pattern with an upward trending behavior. Figure : Foreign exchange rate Lira per U.S. $ from Jannuary 19t3 until October 1989
Example 2 The first difference of the series seems to have a constant mean, although inspection of the graph (see Figure ) suggests thye variance is an increasing function of time. Figure : First difference of the foreign exchange rate Lira per US dollar
Example 2 As we can see in figure, the first difference of the logarithm is the most likely candidate to be covariance stationary. Figure : First difference of the logarithm of the foreign exchange rate Lira per US Dollar.
Example 2 Now, we examine the autocorrelation and partial autocorrelation functions of the logarithmic change in the foreign exchange rate Lira per US Dollar. Figure : SACF and SPACF for the logarithmic change in the foreign exchange rate Lira per US Dollar.
Example 2 An AR(1) model is fitted by using the exact maximum likelihood estimation. The parameter estimates are summarized in the following table
Example 2 Sample 1973:02 1989:10. Dependent Variable: First difference of log of the foreign exchange rate Lira per US Dollar Coefficient Std. error t statistic p-value Variance innov. 0,381412 0,0652368 5,8466 0,0000 0,000543700
Example 2 The AR(1) model fit indicates a highly significant parameter φ 1 with estimate ˆφ 1 = 0, 381.
Example 2 The Q statistic (Q 20 = 16, 5014) and the graphs of the SACF and SPACF of residuals (see Figure )indicate that the autocorrelations of the residuals are not statistically significant. Figure : SACF and SACFP of residuals from the model AR(1)
Example 2 Thus we conclude that the AR(1) model x t = 0.381x t 1 + u t where u t WN(0, 0.00054) and x t is the first difference of log of the foreign exchange rate Lira per US Dollar, fits the data well.
Example 3 We consider the log of GNP deflator series in USA observed on the period 1955:1-2000:4. The objective is to build an ARMA model for this time series.
Example 3 Figure : Log of GNP deflator series in USA observed on the period The time serie graph is shown in figure. We note that the mean is changing over time. The variable exhibts a strong trend. Thus the series cannot be considered a realization of a stationary process.
Example 3 In order to make stationary the series, we consider the first differeces. Figure : Graphical plot of the first difference of log of GNP deflator series
Example 3 Visual inspection gives again strong indication of nonstationarity. Thus we consider the second difference. Figure : Graphical plot of the second difference of log of GNP deflator series
Example 3 The second difference seems the realization of a stationary process with zero mean, thus we can look at sample autocorrelation and partial autocorrelation function of the second difference, to establish the orders p and q of the ARMA model. Figure shows the graphs of SACFs and SPACFs.
Example 3 Additional information can be obtained by inspecting the outcomes of the AIC and BIC criteria. Table : The information criteria: AIC and BIC Orders p,q of ARMA model 2,2 2,1 1,2 1,1 1,0 0,1 AIC -1614.4-1611.3-1616.0-1613.3-1609.7-1614.7 BIC -1595.2-1595.2-1599.9-1600.4-1600.1-1605.1 From AIC values it is concluded that the ARMA(1,2) model is most suitable for our time series. From BIC values, however, the MA(1) is judged to be better suited.
Example 3 The fact that AIC and BIC provided different indications about the best fitting models is not surprising because BIC penalizes larger models more than AIC. Thus BIC tends to produce more parsimonious best-fitting models than AIC.
Example 3 Since computing time is inexpensive we can estimate both models. Table 1 shows the results of fitting an ARMA(1,2) for the second difference of log of GNP deflator.
Example 3 Sample 1955:1 2000:4. Dependent Variable: second difference of log of GNP deflator Variabile Coefficient Std. error t statistic p-value const 8,97976e-06 0,000122030 0,0736 0,9413 φ 1-0,923081 0,0694282-13,2955 0,0000 θ 1 0,438205 0,0999095 4,3860 0,0000 θ 2-0,349970 0,0785200-4,4571 0,0000
Example 3 These graphs are very Umberto similar Triaccato the Lessoncorrelograms 15: Building ARMA models. of aexamples white Now, we can look at sample autocorrelation and partial autocorrelation functions of residuals of the model ARMA(1,2) to establish if this ARMA model is a good model for the data. Figure : SACF and SACFP of residuals from the model ARMA(1,2)
Example 3 The Q K -statistic computed with K = 20 lags is equal to Q 20 = 16.2932, whereas the critical value is χ 2 1 0.05,17 = 27.5871.
Example 3 These results indicate that the ARMA(1,2) model (1 0.923L)x t = (1 + 0.438L 0.350L 2 )u t u t WN(0, 0.85) with x t = (1 L) 2 log(y t ) where y t is the original series, fits the data well.
Example 3 Now, we consider the MA(1) model. Sample 1955:1 2000:4. Dependent Variable: second difference of log of GNP deflator Variabile Coefficient Std. error t statistic p-value const 8,79573e-06 0,000116929 0,0752 0,9400 θ 1-0,466072 0,0615454-7,5728 0,0000
The correlograms and the Box-Pierce statistics (Q 20 = 21.6819) indicate that the residuals behave as white noise processes. Figure : SACF and SACFP of residuals from the model MA(1)
Example 3 Thus we conclude that also the model fits the data well. x t = (1 0.466L)u t u t WN(0, 0.89),
Example 3 Let us look at the forecasting performace of the two models. In particular, we forecast the future values of our time series, log(y t ), from 2001:1 to 2001:4.
Example 3 First, we consider the model (1 0.923L)x t = (1 + 0.438L 0.350L 2 )u t u t WN(0, 0.85)
Example 3 The 1-step, 2-step, 3-step and 4-step forecasts are presented in the following table. Table : ARMA(1,2) forecasts Step ahead Actual Forecast Std. error 2001:1 4,499576 4,498700 0,002913 2001:2 4,506344 4,504065 0,005289 2001:3 4,509474 4,509945 0,007403 2001:4 4,512517 4,515367 0,009934
Example 3 Table presents the forecast obtained by using the MA(1) model x t = (1 0.466L)u t u t WN(0, 0.89), Table : MA(1) forecasts Step ahead Actual Forecast Std. error 2001:1 4,499576 4,498286 0,002956 2001:2 4,506344 4,503785 0,005413 2001:3 4,509474 4,509293 0,008166 2001:4 4,512517 4,514810 0,011218
Example 3 Given these results we may conclude that the performance of two models is very similar. Which model should be prefered?
Example 3 It is usual to choose a parsimonious model, that is a model that describes all of the features of the data of interest using as few parameters as possible.
Example 3 Thus we choose the MA(1) model x t = (1 0.466L)u t u t WN(0, 0.89),