Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br 5 – Autoregressive Integrated Moving Average (ARIMA) Models Box & Jenkins Methodology.

Similar presentations


Presentation on theme: "1 Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br 5 – Autoregressive Integrated Moving Average (ARIMA) Models Box & Jenkins Methodology."— Presentation transcript:

1 1 Previsão | Pedro Paulo Balestrassi | 5 – Autoregressive Integrated Moving Average (ARIMA) Models Box & Jenkins Methodology

2 2 Previsão | Pedro Paulo Balestrassi | ARIMA Box-Jenkins Methodology

3 3 Previsão | Pedro Paulo Balestrassi | The series show an upward trend. The first several autocorrelations are persistently large and trailed off to zero rather slowly  a trend exists and this time series is nonstationary (it does not vary about a fixed level) Idea: to difference the data to see if we could eliminate the trend and create a stationary series. Example 1/4

4 4 Previsão | Pedro Paulo Balestrassi | First order differences. A plot of the differenced data appears to vary about a fixed level. Comparing the autocorrelations with their error limits, the only significant autocorrelation is at lag 1. Similarly, only the lag 1 partial autocorrelation is significant. The PACF appears to cut off after lag 1, indicating AR(1) behavior. The ACF appears to cut off after lag 1, indicating MA(1) behavior  we will try: ARIMA(1,1,0) and ARIMA(0,1,1) A constant term in each model will be included to allow for the fact that the series of differences appears to vary about a level greater than zero. Example 2/4

5 5 Previsão | Pedro Paulo Balestrassi | ARIMA(1,1,0) ARIMA(0,1,1) Example 3/4 The LBQ statistics are not significant as indicated by the large p- values for either model.

6 6 Previsão | Pedro Paulo Balestrassi | Therefore, either model is adequate and provide nearly the same one-step-ahead forecasts. Example 4/4 Finally, there is no significant residual autocorrelation for the ARIMA(1,1,0) model. The results for the ARIMA(0,1,1) are similar.

7 7 Previsão | Pedro Paulo Balestrassi | Makridakis –ARIMA 7.1 –ARIMA PIGS –ARIMA DJ –ARIMA Electricity –ARIMA Computers –ARIMA Sales Industry –ARIMA Pollution Examples Minitab –Employ (Food) Montgomery –EXEMPLO PAG 267 –EXEMPLO PAG 271 –EXEMPLO PAG 278 –EXEMPLO PAG 283

8 8 Previsão | Pedro Paulo Balestrassi | ARIMA Basic Model

9 9 Previsão | Pedro Paulo Balestrassi | Basic Models ARIMA (0, 0, 0)―WHITE NOISE ARIMA (0, 1, 0)―RANDOM WALK ARIMA (1, 0, 0)―AUTOREGRESSIVE MODEL (order 1) ARIMA (0, 0, 1)―MOVING AVERAGE MODEL (order 1) ARIMA (1, 0, 1)―SIMPLE MIXED MODEL

10 10 Previsão | Pedro Paulo Balestrassi | AR MA Example Models

11 11 Previsão | Pedro Paulo Balestrassi | Autocorrelation - ACF Lag ACF T LBQ 1 0, ,15 0, , ,32 0,17 Diferenças são devido a pequenas modificações nas fórmulas de Regressão e Time Series

12 12 Previsão | Pedro Paulo Balestrassi | Partial Correlation Suppose X, Y and Z are random variables. We define the notion of partial correlation between X and Y adjusting for Z. First consider simple linear regression of X on Z Also the linear regression of Y on Z

13 13 Previsão | Pedro Paulo Balestrassi | Partial Correlation Now consider the errors Then the partial correlation between X and Y, adjusting for Z, is

14 14 Previsão | Pedro Paulo Balestrassi | Partial Autocorrelation - PACF Diferenças são devido a pequenas modificações nas fórmulas de Regressão e Time Series Correlations: X*; Y* Pearson correlation of X* and Y* =0,770 P-Value = 0,000 Partial Autocorrelation Function: X Lag PACF T 1 0, , , ,17 3 0, ,64 (1) (2) (3) (4) (5) (6) (7) (8) Corr(X*, Y*)

15 15 Previsão | Pedro Paulo Balestrassi | ACF  0 PACF = 0 for lag > 1 Theorectical Behavior for AR(1)

16 16 Previsão | Pedro Paulo Balestrassi | Theorectical Behavior for AR(2) ACF  0 PACF = 0 for lag > 2

17 17 Previsão | Pedro Paulo Balestrassi | PACF  0 ACF = 0 for lag > 1 Theorectical Behavior for MA (1)

18 18 Previsão | Pedro Paulo Balestrassi | Theorectical Behavior for MA(2) PACF  0 PACF = 0 for lag > 2

19 19 Previsão | Pedro Paulo Balestrassi | Note that: ARMA(p,0) = AR(p) ARMA(0,q) = MA(q) In practice, the values of p and q each rarely exceed 2. ACFPACF AR(p) Die outCut off after the order p of the process MA(q) Cut off after the order q of the process Die out ARMA(p,q) Die out In this context… “Die out” means “tend to zero gradually” “Cut off” means “disappear” or “is zero” Theorectical Behavior

20 20 Previsão | Pedro Paulo Balestrassi | Review of Main Characteristics of ACF and PACF

21 21 Previsão | Pedro Paulo Balestrassi | Example 5.1 Weekly total number of loan applications EXEMPLO PAG 267.MPJ The weekly data tend to have short runs and that the data seem to be indeed autocorrelated. Next, we visually inspect the stationarity. Although there might be a slight drop in the mean for the second year (weeks ), in general it seems to be safe to assume stationarity.

22 22 Previsão | Pedro Paulo Balestrassi | 22 Example It has an (or a mixture ot) exponential decay(s) pattern suggesting an AR(p) model. 1. It cuts off after lag 2 (or maybe even 3), suggesting a MA(2) (or MA(3)) model.

23 23 Previsão | Pedro Paulo Balestrassi | 23 Example 5.1 It cuts off after lag 2. Hence we use the second interpretation of the sample ACF plot and assume that the appropriate model to fit is the AR(2) model.

24 24 Previsão | Pedro Paulo Balestrassi | Example 5.1 The modified Box-Pierce test suggests that there is no autocorrelation left in the residuals.

25 25 Previsão | Pedro Paulo Balestrassi | Example 5.1

26 26 Previsão | Pedro Paulo Balestrassi | Example 5.1

27 27 Previsão | Pedro Paulo Balestrassi | Example 5.1

28 28 Previsão | Pedro Paulo Balestrassi | Example 5.2 Dow Jones Index The process shows signs of nonstationarity with changing mean and possibly variance. Exemplo: Página 271

29 29 Previsão | Pedro Paulo Balestrassi | Example 5.2 The slowly decreasing sample ACF and sample PACF with significant value at lag 1, which is close to 1 confirm that indeed the process can be deemed nonstationary.

30 30 Previsão | Pedro Paulo Balestrassi | Example 5.2 One might argue that the significant sample PACF value at lag I suggests that the AR( I) model might also fit the data well. We will consider this interpretation first and fit an AR( I) model to the Dow Jones Index data.

31 31 Previsão | Pedro Paulo Balestrassi | Example 5.2 The modified Box-Pierce test suggests that there is no autocorrelation left in the residuals. This is also confirmed by the sample ACF and PACF plots of the residuals

32 32 Previsão | Pedro Paulo Balestrassi | Example 5.2

33 33 Previsão | Pedro Paulo Balestrassi | Example 5.2 The only concern in the residual plots in is in the changing variance observed in the time series plot of the residuals.

34 34 Previsão | Pedro Paulo Balestrassi | Example 5.2

35 35 Previsão | Pedro Paulo Balestrassi | Example 5.2

36 36 Previsão | Pedro Paulo Balestrassi | Example 5.2

37 37 Previsão | Pedro Paulo Balestrassi | Example 5.2

38 38 Previsão | Pedro Paulo Balestrassi | Example 5.3 Prediction with AR(2) Exemplo pag 278

39 39 Previsão | Pedro Paulo Balestrassi | Example 5.3

40 40 Previsão | Pedro Paulo Balestrassi | Example 5.3

41 41 Previsão | Pedro Paulo Balestrassi | Example 5.5 U.S. Clothing Sales Data The data obviously exhibit some seasonality and upward linear trend. c Exemplo: Página 283

42 42 Previsão | Pedro Paulo Balestrassi | Example 5.5 The sample ACF and PACF indicate a monthly seasonality, s = 12, as ACF values at lags 12, 24, 36 are significant and slowly decreasing

43 43 Previsão | Pedro Paulo Balestrassi | Example 5.5 The sample ACF and PACF indicate a monthly seasonality, s = 12, as ACF values at lags 12, 24, 36 are significant and slowly decreasing

44 44 Previsão | Pedro Paulo Balestrassi | Example 5.5 There is a significant PACF value at lag 12 that is close to 1. Moreover, the slowly decreasing ACF in general also indicates a nonstationarity that can be remedied by taking the first difference. Hence we would now consider

45 45 Previsão | Pedro Paulo Balestrassi | Example 5.5

46 46 Previsão | Pedro Paulo Balestrassi | Example 5.5 There is a significant PACF value at lag 12 that is close to 1. Moreover, the slowly decreasing ACF in general also indicates a nonstationarity that can be remedied by taking the first difference. Hence we would now consider

47 47 Previsão | Pedro Paulo Balestrassi | Example 5.5 Figure shows that first difference together with seasonal differencing helps in terms of stationarity and eliminating the seasonality

48 48 Previsão | Pedro Paulo Balestrassi | Example 5.5

49 49 Previsão | Pedro Paulo Balestrassi | Example 5.5 The sample ACF with a significant value at lag 1 and the sample PACF with exponentially decaying values at the first 8 lags suggest that a nonseasonal MA( I) model should be used.

50 50 Previsão | Pedro Paulo Balestrassi | Example 5.5 The interpretation of the remaining seasonality is a bit more difficult. For that we should focus on the sample ACF and PACF values at lags , 36, and so on. The sample ACF at lag 12 seems to be significant and the sample PACF at lags 12, 24, 36 (albeit not significant) seems to be alternating in sign. That suggests that a seasonal MA(1) model can be used as well. Hence an ARIMA (0, 1, 1) x (0, 1, 1) 12 model is used to model the data, yt

51 51 Previsão | Pedro Paulo Balestrassi | Example 5.5 Both MA( 1) and seasonal MA( 1) coefficient estimates are significant. As we can see from the sample ACF and PACF plots, while there are still some small significant values, as indicated by the modified Box-Pierce statistic, most of the autocorrelation is now modeled out.

52 52 Previsão | Pedro Paulo Balestrassi | Example 5.5 As we can see from the sample ACF and PACF plots, while there are still some small significant values, as indicated by the modified Box-Pierce statistic, most of the autocorrelation is now modeled out.

53 53 Previsão | Pedro Paulo Balestrassi | Example 5.5

54 54 Previsão | Pedro Paulo Balestrassi | Example 5.5

55 55 Previsão | Pedro Paulo Balestrassi | Introduction Exponential smoothing. The general assumption for these models was that any time series data can be represented as the sum of two distinct components: deterministic and stochastic (random). The former (deterministic) is modeled as a function of time whereas for the latter (stochastic) we assumed that some random noise that is added on the deterministic signal generates the stochastic behavior of the time series. One very important assumption is that the random noise is generated through independent shocks to the process. In practice, however, this assumption is often violated. That is, usually successive observations show serial dependence. Under these circumstances, forecasting methods based on exponential smoothing may be inefficient and sometimes inappropriate because they do not take advantage of the serial dependence in the observations in the most effective way. To formally incorporate this dependent structure, we will explore a general class of models called autoregressive integrated moving average models or ARIMA models (also known as Box-Jenkins models).

56 56 Previsão | Pedro Paulo Balestrassi | Linear Models for Stationary Time Series A linear filter is defined as is said to be Um conceito de Processamento de Sinais

57 57 Previsão | Pedro Paulo Balestrassi | Stationarity

58 58 Previsão | Pedro Paulo Balestrassi | Some Examples

59 59 Previsão | Pedro Paulo Balestrassi | Stationary Time Series Many time series do not exhibit a stationary behavior The stationarity is in fact a rarity in real life However it provides a foundation to build upon since (as we will see later on) if the time series in not stationary, its first difference (y t -y t-1 ) will often be

60 60 Previsão | Pedro Paulo Balestrassi | Linear Filter

61 61 Previsão | Pedro Paulo Balestrassi | If Input is White Noise

62 62 Previsão | Pedro Paulo Balestrassi | Using the Backshift Operator

63 63 Previsão | Pedro Paulo Balestrassi | Wold’s Decomposition Theorem Any nondeterministic weakly stationary time series can be written as an infinite sum of weighted random shocks (disturbances) where

64 64 Previsão | Pedro Paulo Balestrassi | How useful is this? Well, not so much!!! How can we come up with “infinitely” many terms?

65 65 Previsão | Pedro Paulo Balestrassi | Maybe we should consider some special cases:

66 66 Previsão | Pedro Paulo Balestrassi | Finite Order Moving Average Processes (Ma(q))

67 67 Previsão | Pedro Paulo Balestrassi | Some Properties Expected Value Variance

68 68 Previsão | Pedro Paulo Balestrassi | Some Properties Autocovariance Function Autocorrelation Function (ACF)

69 69 Previsão | Pedro Paulo Balestrassi | Autocorrelation Function of MA(q) ACF of Ma(q) ”cuts off” after lag q This is very useful in the identification of an MA(q) process

70 70 Previsão | Pedro Paulo Balestrassi | Example Employ.mtw

71 71 Previsão | Pedro Paulo Balestrassi | Diferences

72 72 Previsão | Pedro Paulo Balestrassi | Because you did not specify the lag length, autocorrelation uses the default length of n / 4 for a series with less than or equal to 240 observations. Minitab generates an autocorrelation function (ACF) with approximate a = 0.05 critical bands for the hypothesis that the correlations are equal to zero. The graphs for the autocorrelation function (ACF) of the ARIMA residuals include lines representing two standard errors to either side of zero. Values that extend beyond two standard errors are statistically significant at approximately a = 0.05, and show evidence that the model does not explain thel autocorrelation in the data. Autocorrelation

73 73 Previsão | Pedro Paulo Balestrassi | The ACF for these data shows large positive, significant spikes at lags 1 and 2 with subsequent positive autocorrelations that do not die off quickly. This pattern is typical of an autoregressive process. Autocorrelation

74 74 Previsão | Pedro Paulo Balestrassi | Ljung-Box q statistic Use to test whether a series of observations over time are random and independent. If observations are not independent, one observation may be correlated with another observation k time units later, a relationship called autocorrelation. Autocorrelation can impair the accuracy of a time-based predictive model, such as time series plot, and lead to misinterpretation of the data. For example, an electronics company tracks monthly sales of batteries for five years. They want to use the data to develop a time series model to help forecast future sales. However, monthly sales may be affected by seasonal trends. For example, every year a rise in sales occurs when people buy batteries for Christmas toys. Thus a monthly sales observation in one year could be correlated with a monthly sales observations 12 months later (a lag of 12). Before choosing their time series model, they can evaluate autocorrelation for the monthly differences in sales. The Ljung-Box Q (LBQ) statistic tests the null hypothesis that autocorrelations up to lag k equal zero (i.e., the data values are random and independent up to a certain number of lags--in this case 12). If the LBQ is greater than a specified critical value, autocorrelations for one or more lags may be significantly different from zero, suggesting the values are not random and independent over time. LBQ is also used to evaluate assumptions after fitting a time series model, such as ARIMA, to ensure that the residuals are independent. The Ljung-Box is a Portmanteau test and is a modified version of the Box-Pierce chi-square statistic.

75 75 Previsão | Pedro Paulo Balestrassi | You can use the Ljung-Box Q (LBQ) statistic to test the null hypothesis that the autocorrelations for all lags up to lag k equal zero. Let's test that all autocorrelations up to a lag of 6 are zero. The LBQ statistic is Ho: Autocorrelation (lag<6) = 0 Variable CumProb is created

76 76 Previsão | Pedro Paulo Balestrassi |

77 77 Previsão | Pedro Paulo Balestrassi | In this example, the p-value is , which means the p- value is less than The very small p-value implies that one or more of the autocorrelations up to lag 6 can be judged as significantly different from zero at any reasonable a level.

78 78 Previsão | Pedro Paulo Balestrassi | Partial autocorrelation computes and plots the partial autocorrelations of a time series. Partial autocorrelations, like autocorrelations, are correlations between sets of ordered data pairs of a time series. As with partial correlations in the regression case, partial autocorrelations measure the strength of relationship with other terms being accounted for. The partial autocorrelation at a lag of k is the correlation between residuals at time t from an autoregressive model and observations at lag k with terms for all intervening lags present in the autoregressive model. The plot of partial autocorrelations is called the partial autocorrelation function or PACF. View the PACF to guide your choice of terms to include in an ARIMA model.

79 79 Previsão | Pedro Paulo Balestrassi | You obtain a partial autocorrelation function (PACF) of the food industry employment data, after taking a difference of lag 12, in order to help determine a likely ARIMA model.

80 80 Previsão | Pedro Paulo Balestrassi | Minitab generates a partial autocorrelation function with critical bands at approximately a = 0.05 for the hypothesis that the correlations are equal to zero. In the food data example, there is a single large spike of 0.7 at lag 1, which is typical of an autoregressive process of order one. There is also a significant spike at lag 9, but you have no evidence of a nonrandom process occurring there.

81 81 Previsão | Pedro Paulo Balestrassi |

82 82 Previsão | Pedro Paulo Balestrassi | Sample ACF Will not be equal to zero after lag q for an MA(q) But it will be small For the same size of N, this can be tested using the limits:

83 83 Previsão | Pedro Paulo Balestrassi | First-Order Moving Average Process MA(1) for which autocovariance and autocorrelation functions are given as

84 84 Previsão | Pedro Paulo Balestrassi | Some Examples Note, the behavior of sample ACF

85 85 Previsão | Pedro Paulo Balestrassi | Second-Order Moving Average Process MA(2) for which autocovariance and autocorrelation functions are given as

86 86 Previsão | Pedro Paulo Balestrassi | An Example

87 87 Previsão | Pedro Paulo Balestrassi | Finite Order Autoregressive Processes (AR(p)) MA(q) processes take into account disturbances up to q lags in the past What if all past disturbances have some lingering effects? Back to square one? We may be able to come up with some special cases though

88 88 Previsão | Pedro Paulo Balestrassi | A very special case What if we let

89 89 Previsão | Pedro Paulo Balestrassi | Decomposition and

90 90 Previsão | Pedro Paulo Balestrassi | Combining the two equations This is an AR(1) model

91 91 Previsão | Pedro Paulo Balestrassi | First-Order Autoregressive Process (AR(1))

92 92 Previsão | Pedro Paulo Balestrassi | Properties Expected Value Autocovariance Function Autocorrelation Function

93 93 Previsão | Pedro Paulo Balestrassi | Some Examples

94 94 Previsão | Pedro Paulo Balestrassi | Second-Order Autoregressive Process (AR(2))

95 95 Previsão | Pedro Paulo Balestrassi | Conditions for Stationarity

96 96 Previsão | Pedro Paulo Balestrassi | AR(2) is stationary if …

97 97 Previsão | Pedro Paulo Balestrassi | AR(2) is stationary if …

98 98 Previsão | Pedro Paulo Balestrassi | AR(2) Hence {  j } satisfy the 2 nd order linear difference equation. So the  i can be expressed as the solution to this equation in terms of the 2 roots m 1 and m 2 of the associated polynomial If the roots m 1 and m 2 satisfy

99 99 Previsão | Pedro Paulo Balestrassi | AR(2) is stationary if the roots m 1 and m 2 of are both less than one in absolute value

100 100 Previsão | Pedro Paulo Balestrassi | ACF of a stationary AR(2)

101 101 Previsão | Pedro Paulo Balestrassi | ACF of a stationary AR(2) Yule-Walker Equations

102 102 Previsão | Pedro Paulo Balestrassi | ACF of a stationary AR(2) Hence ACF satisfies the 2 nd order linear difference equation. So the  (k) can be expressed as the solution to this equation in terms of the 2 roots m 1 and m 2 of the associated polynomial

103 103 Previsão | Pedro Paulo Balestrassi | ACF of a stationary AR(2)

104 104 Previsão | Pedro Paulo Balestrassi | Some Examples

105 105 Previsão | Pedro Paulo Balestrassi | AR(p)

106 106 Previsão | Pedro Paulo Balestrassi | AR(p) is Stationary If the roots of are less than one in absolute value.

107 107 Previsão | Pedro Paulo Balestrassi | Infinite MA representation

108 108 Previsão | Pedro Paulo Balestrassi | Expected Value of an AR(p)

109 109 Previsão | Pedro Paulo Balestrassi | Autocovariance Function of an AR(p)

110 110 Previsão | Pedro Paulo Balestrassi | Autocorrelation Function of an AR(p)

111 111 Previsão | Pedro Paulo Balestrassi | ACF of AR(p) In general ACF of AR(p) can be a mixture of exponential decay and damped sinusoidal behavior depending on the solution to the corresponding Yule-Walker equations.

112 112 Previsão | Pedro Paulo Balestrassi | ACF of AR(p)

113 113 Previsão | Pedro Paulo Balestrassi | ACF for AR(p) and MA(q) ACF of MA(q) “cuts off” after q ACF of AR(p) can be a mixture of exponential decay and damped sinusoidal

114 114 Previsão | Pedro Paulo Balestrassi | So how are we going to determine p in the AR(p) model?

115 115 Previsão | Pedro Paulo Balestrassi | Partial Correlation Suppose X, Y and Z are random variables. We define the notion of partial correlation between X and Y adjusting for Z. First consider simple linear regression of X on Z Also the linear regression of Y on Z

116 116 Previsão | Pedro Paulo Balestrassi | Partial Correlation Now consider the errors Then the partial correlation between X and Y, adjusting for Z, is

117 117 Previsão | Pedro Paulo Balestrassi | Partial Autocorrelation Function (PACF)

118 118 Previsão | Pedro Paulo Balestrassi | Partial Autocorrelation Function (PACF)

119 119 Previsão | Pedro Paulo Balestrassi | Partial Autocorrelation Function (PACF)

120 120 Previsão | Pedro Paulo Balestrassi | Partial Autocorrelation Function (PACF)

121 121 Previsão | Pedro Paulo Balestrassi | Sample Partial Autocorrelation Function

122 122 Previsão | Pedro Paulo Balestrassi | Some Examples

123 123 Previsão | Pedro Paulo Balestrassi | PACF For an AR(p) process, PACF cuts off after lag p. For an MA(q) process, PACF has an exponential decay and/or a damped sinusoid form

124 124 Previsão | Pedro Paulo Balestrassi | Invertibility of a MA Process

125 125 Previsão | Pedro Paulo Balestrassi | Invertibility of a MA Process

126 126 Previsão | Pedro Paulo Balestrassi | Invertibility of a MA Process We have

127 127 Previsão | Pedro Paulo Balestrassi | The ACF and PACF do have very distinct and indicative properties for MA and AR models. Therefore in model identification it is strongly recommended to use both the sample ACF and PACF simultaneously

128 128 Previsão | Pedro Paulo Balestrassi | Mixed Autoregressive-Moving Average (ARMA(p,q)) Process

129 129 Previsão | Pedro Paulo Balestrassi | Stationarity of ARMA(p,q)

130 130 Previsão | Pedro Paulo Balestrassi | Invertibility of ARMA(p,q)

131 131 Previsão | Pedro Paulo Balestrassi | ACF and PACF of an ARMA(p,q) Both ACF and PACF of an ARMA(p,q) can be a mixture of exponential decay and damped sinusoids depending on the roots of the AR operator.

132 132 Previsão | Pedro Paulo Balestrassi | ARMA Models For ARMA models, except for possible special cases, neither ACF nor PACF has distinctive features that would allow “easy identification” For this reason, there have been many additional sample functions considered to help with identification problem: –Extended sample ACF (ESACF) –Generalized sample PACF (GPACF) –Inverse ACF –Use of “canonical correlations”

133 133 Previsão | Pedro Paulo Balestrassi | Some Examples

134 134 Previsão | Pedro Paulo Balestrassi | Review of Main Characteristics of ACF and PACF

135 135 Previsão | Pedro Paulo Balestrassi | Review of Main Characteristics of Sample ACF and PACF

136 136 Previsão | Pedro Paulo Balestrassi | Some Examples

137 137 Previsão | Pedro Paulo Balestrassi | Some Examples

138 138 Previsão | Pedro Paulo Balestrassi | Some Examples

139 139 Previsão | Pedro Paulo Balestrassi | Some Examples

140 140 Previsão | Pedro Paulo Balestrassi | Some Examples

141 141 Previsão | Pedro Paulo Balestrassi | ARIMA Models Process {y t } is ARIMA(p,d,q), if the d th order differences, w t =(1-B) d y t, form a stationary ARMA(p,q) process: Thus {y t } satisfies

142 142 Previsão | Pedro Paulo Balestrassi | Some Examples

143 143 Previsão | Pedro Paulo Balestrassi | Some Examples

144 144 Previsão | Pedro Paulo Balestrassi | Model Building Given T observations from a process, want to obtain a model that adequately represents the main features of the time series data. Model can be used for purposes of forecasting, control, …

145 145 Previsão | Pedro Paulo Balestrassi | 3-Stage Procedure STAGE 1: Model Specification or Identification –Consider issue of nonstationarity vs. stationarity of series. Use procedures such as differencing to obtain a stationary series; say w t =(1-B) d y t Examine sample ACF and PACF of w t and use features of these functions to identify an appropriate ARMA model. The specification is “tentative”

146 146 Previsão | Pedro Paulo Balestrassi | Review of Main Characteristics of ACF and PACF

147 147 Previsão | Pedro Paulo Balestrassi | Review of Main Characteristics of Sample ACF and PACF

148 148 Previsão | Pedro Paulo Balestrassi | ARMA Models For ARMA models, except for possible special cases, neither ACF nor PACF has distinctive features that would allow “easy identification” For this reason, there have been many additional sample functions considered to help with identification problem: –Extended sample ACF (ESACF) –Generalized sample PACF (GPACF) –Inverse ACF –Use of “canonical correlations”

149 149 Previsão | Pedro Paulo Balestrassi | 3-Stage Procedure STAGE 2: Estimation of Parameters in Tentatively Specified Model –Method of moments –Least Squares –Maximum Likelihood

150 150 Previsão | Pedro Paulo Balestrassi | 3-Stage Procedure STAGE 3: Model Checking –Based on examining features of residuals

151 151 Previsão | Pedro Paulo Balestrassi | 3-Stage Procedure STAGE 3: If the specified model is appropriate order p, q; then we expect the residuals behave similar to the “true” white noise  t.

152 152 Previsão | Pedro Paulo Balestrassi | Example 5.1 Weekly total number of loan applications

153 153 Previsão | Pedro Paulo Balestrassi | 153 Example 5.1

154 154 Previsão | Pedro Paulo Balestrassi | Example 5.1

155 155 Previsão | Pedro Paulo Balestrassi | Example 5.1

156 156 Previsão | Pedro Paulo Balestrassi | Example 5.1

157 157 Previsão | Pedro Paulo Balestrassi | Example 5.1

158 158 Previsão | Pedro Paulo Balestrassi | Example 5.1

159 159 Previsão | Pedro Paulo Balestrassi | Example 5.2 Dow Jones Index

160 160 Previsão | Pedro Paulo Balestrassi | Example 5.2

161 161 Previsão | Pedro Paulo Balestrassi | Example 5.2

162 162 Previsão | Pedro Paulo Balestrassi | Example 5.2

163 163 Previsão | Pedro Paulo Balestrassi | Example 5.2

164 164 Previsão | Pedro Paulo Balestrassi | Example 5.2

165 165 Previsão | Pedro Paulo Balestrassi | Example 5.2

166 166 Previsão | Pedro Paulo Balestrassi | Example 5.2

167 167 Previsão | Pedro Paulo Balestrassi | Example 5.2

168 168 Previsão | Pedro Paulo Balestrassi | Example 5.2

169 169 Previsão | Pedro Paulo Balestrassi | Forecasting ARIMA Processes

170 170 Previsão | Pedro Paulo Balestrassi | Forecasting ARIMA Processes

171 171 Previsão | Pedro Paulo Balestrassi | The “best” forecast

172 172 Previsão | Pedro Paulo Balestrassi | Forecast Error

173 173 Previsão | Pedro Paulo Balestrassi | Prediction Intervals

174 174 Previsão | Pedro Paulo Balestrassi | Two Issues

175 175 Previsão | Pedro Paulo Balestrassi | Illustration Using ARIMA(1,1,1) ARIMA(1,1,1) process is given as Two commonly used approaches

176 176 Previsão | Pedro Paulo Balestrassi | Approach 1

177 177 Previsão | Pedro Paulo Balestrassi | Approach 2

178 178 Previsão | Pedro Paulo Balestrassi | Example 5.3

179 179 Previsão | Pedro Paulo Balestrassi | Seasonal Processes

180 180 Previsão | Pedro Paulo Balestrassi | Seasonal Processes

181 181 Previsão | Pedro Paulo Balestrassi | Seasonal Processes

182 182 Previsão | Pedro Paulo Balestrassi | Seasonal Processes

183 183 Previsão | Pedro Paulo Balestrassi | Example 5.4

184 184 Previsão | Pedro Paulo Balestrassi | Example 5.5 U.S. Clothing Sales Data

185 185 Previsão | Pedro Paulo Balestrassi | Example 5.5

186 186 Previsão | Pedro Paulo Balestrassi | Example 5.5

187 187 Previsão | Pedro Paulo Balestrassi | Example 5.5

188 188 Previsão | Pedro Paulo Balestrassi | Example 5.5

189 189 Previsão | Pedro Paulo Balestrassi | Example 5.5

190 190 Previsão | Pedro Paulo Balestrassi | Example 5.5

191 191 Previsão | Pedro Paulo Balestrassi | Example 5.5

192 192 Previsão | Pedro Paulo Balestrassi | Example 5.5

193 193 Previsão | Pedro Paulo Balestrassi | Example 5.5

194 194 Previsão | Pedro Paulo Balestrassi | Use ARIMA to model time series behavior and to generate forecasts. ARIMA fits a Box-Jenkins ARIMA model to a time series. ARIMA stands for Autoregressive Integrated Moving Average with each term representing steps taken in the model construction until only random noise remains. ARIMA modeling differs from the other time series methods in the fact that ARIMA modeling uses correlational techniques. ARIMA can be used to model patterns that may not be visible in plotted data.

195 195 Previsão | Pedro Paulo Balestrassi | The ACF and PACF of the food employment data suggest an autoregressive model of order 1, or AR(1), after taking a difference of order 12. You fit that model here, examine diagnostic plots, and examine the goodness of fit. To take a seasonal difference of order 12, you specify the seasonal period to be 12, and the order of the difference to be 1.

196 196 Previsão | Pedro Paulo Balestrassi | 1 Model is specified by the usual notation (pdq) x (PDQ) S: (pdq) is for a nonseasonal model; (PDQ) for a seasonal, and S is the seasonality. 2 At least one of the p, P, q, or Q parameters must be non-zero, and none may exceed five. 3 The maximum number of parameters you can estimate is ten. 4 At least three data points must remain after differencing. That is, S * D + d + 2 must be less than the number of points, where S is the length of a season. 5 The maximum "back order" for the model is 100. In practice, this condition is always satisfied if S * D + d + p + P + q + Q is at most The ARIMA model normally includes a constant term only if there is no differencing (that is, d = D = 0). 7 Missing observations are only allowed at the beginning or the end of a series, not in the middle. 8 The seasonal component of this model is multiplicative, and thus is appropriate when the amount of cyclical variation is proportional to the mean.

197 197 Previsão | Pedro Paulo Balestrassi | The ARIMA model converged after nine iterations. The AR(1) parameter had a t-value of As a rule of thumb, you can consider values over two as indicating that the associated parameter can be judged as significantly different from zero. The MSE (1.1095) can be used to compare fits of different ARIMA models. The Ljung-Box statistics give nonsignificant p-values, indicating that the residuals appeared to uncorrelated. The ACF and PACF of the residuals corroborate this. You assume that the spikes in the ACF and PACF at lag 9 are the result of random events The coefficients are estimated using an iterative algorithm that calculates least squares estimates. At each iteration, the back forecasts are computed and SSE is calculated. Back forecasts are calculated using the specified model and the current iteration's parameter estimates

198 198 Previsão | Pedro Paulo Balestrassi | Box and Jenkins [2] present an interactive approach for fitting ARIMA models to time series. This iterative approach involves identifying the model, estimating the parameters, checking model adequacy, and forecasting, if desired. The model identification step generally requires judgment from the analyst.[2] 1 First, decide if the data are stationary. That is, do the data possess constant mean and variance. · Examine a time series plot to see if a transformation is required to give constant variance. · Examine the ACF to see if large autocorrelations do not die out, indicating that differencing may be required to give a constant mean. A seasonal pattern that repeats every k th time interval suggests taking the k th difference to remove a portion of the pattern. Most series should not require more than two difference operations or orders. Be careful not to overdifference. If spikes in the ACF die out rapidly, there is no need for further differencing. A sign of an overdifferenced series is the first autocorrelation close to -0.5 and small values elsewhere.

199 199 Previsão | Pedro Paulo Balestrassi | 2 Next, examine the ACF and PACF of your stationary data in order to identify what autoregressive or moving average models terms are suggested. · An ACF with large spikes at initial lags that decay to zero or a PACF with a large spike at the first and possibly at the second lag indicates an autoregressive process. · An ACF with a large spike at the first and possibly at the second lag and a PACF with large spikes at initial lags that decay to zero indicates a moving average process. · The ACF and the PACF both exhibiting large spikes that gradually die out indicates that both autoregressive and moving averages processes are present. For most data, no more than two autoregressive parameters or two moving average parameters are required in ARIMA models.

200 200 Previsão | Pedro Paulo Balestrassi | 3 Once you have identified one or more likely models, you are ready to use the ARIMA procedure. · Fit the likely models and examine the significance of parameters and select one model that gives the best fit. · Check that the ACF and PACF of residuals indicate a random process, signified when there are no large spikes. You can easily obtain an ACF and a PACF of residual using ARIMA's Graphs subdialog box. If large spikes remain, consider changing the model. · You may perform several iterations in finding the best model. When you are satisfied with the fit, go ahead and make forecasts. The ARIMA algorithm will perform up to 25 iterations to fit a given model. If the solution does not converge, store the estimated parameters and use them as starting values for a second fit. You can store the estimated parameters and use them as starting values for a subsequent fit as often as necessary.

201 201 Previsão | Pedro Paulo Balestrassi | The graphs for the ACF and PACF of the ARIMA residuals include lines representing two standard errors to either side of zero. Values that extend beyond two standard errors are statistically significant at approximately a = 0.05, and show evidence that the model has not explained all autocorrelation in the data.

202 202 Previsão | Pedro Paulo Balestrassi |

203 203 Previsão | Pedro Paulo Balestrassi | The AR(1) model appears to fit well so you use it to forecast employment.

204 204 Previsão | Pedro Paulo Balestrassi |

205 205 Previsão | Pedro Paulo Balestrassi |

206 206 Previsão | Pedro Paulo Balestrassi | The ARIMA algorithm is based on the fitting routine in the TSERIES package written by Professor William Q. Meeker, Jr., of Iowa State University. W.Q. Meeker, Jr. (1977). "TSERIES-A User- oriented Computer Program for Identifying, Fitting and Forecasting ARIMA Time Series Models," ASA 1977 Proceedings of the Statistical Computing Section. W.Q. Meeker, Jr. (1977). TSERIES User's Manual, Statistical Laboratory, Iowa State University.


Download ppt "1 Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br 5 – Autoregressive Integrated Moving Average (ARIMA) Models Box & Jenkins Methodology."

Similar presentations


Ads by Google