Posts Tagged ‘ARIMA’

Forecast Friday Changes; Resumes February 3

January 17, 2011

Readers,

We’re currently in the phase of the Forecast Friday series that discusses ARIMA models. This week’s post was to discuss the autoregressive (AR), moving average (MA) and autoregressive moving average (ARMA) models, and then the posts for the next three weeks would delve into ARIMA models. Given the complexity of the topic, along with increasing client load at Analysights, I no longer have the time to cover this topic in the detail it requires. Therefore, I have decided pull ARIMA out of the series. Forecast Friday will resume February 3, when we will begin our discussion of judgmental forecasting methods.

For those of you interested in learning about ARIMA, I invite you to check out some resources that have helped me through college and graduate school:

  1. Introductory Business & Economic Forecasting, 2nd Edition. Newbold, P. and Bos, T., Chapter 7.
  2. Forecasting Methods and Applications,3rd Edition. Makridakis,S., Wheelwright, S. and Hyndman, R., Chapters 7-8.
  3. Introducing Econometrics. Brown, W., Chapter 9.

I apologize for this inconvenience, and thank you for your understanding.

Alex

Advertisements

Forecast Friday Topic: Stationarity in Time Series Data

January 13, 2011

(Thirty-fifth in a series)

In last week’s Forecast Friday post, we began our coverage of ARIMA modeling with a discussion of the Autocorrelation Function (ACF). We also learned that in order to generate forecasts from a time series, the series needed to exhibit no trend (either up or down), fluctuate around a constant mean and variance, and have covariances between terms in the series that depended only on the time interval between the terms, and not their absolute locations in the time series. A time series that meets these criteria is said to be stationary. When a time series appears to have a constant mean, then it is said to be stationary in the mean. Similarly, if the variance of the series doesn’t appear to change, then the series is also stationary in the variance.

Stationarity is nothing new in our discussions of time series forecasting. While we may not have discussed it in detail, we did note that the absence of stationarity made moving average methods less accurate for short-term forecasting, which led into our discussion of exponential smoothing. When the time series exhibited a trend, we relied upon double exponential smoothing to adjust for nonstationarity; in our discussions of regression analysis, we ensured stationarity by decomposing the time series (removing the trend, seasonal, cyclical, and irregular components), adding seasonal dummy variables into the model, and lagging the dependent variable. The ACF is another way of detecting seasonality. And that is what we’ll discuss today.

Recall our ACF from last week’s Forecast Friday discussion:

Because there is no discernable pattern, and because the lags pierce the ±1.96 standard error boundaries less than 5% (in fact, zero percent) of the time, this time series is stationary. Let’s do a simple plot of our time series:

A simple eyeballing of the time series plot shows that the series’ mean and variance both seem to hold fairly constant for the duration of the data set. But now let’s take a look at another data set. In the table below, which I snatched from my graduate school forecasting textbook, we have 160 quarterly observations on real gross national product:

160 Quarters of U.S. Real Gross Domestic Product

t

Xt

t

Xt

t

Xt

t

Xt

1

1,148.2

41

1,671.6

81

2,408.6

121

3,233.4

2

1,181.0

42

1,666.8

82

2,406.5

122

3,157.0

3

1,225.3

43

1,668.4

83

2,435.8

123

3,159.1

4

1,260.2

44

1,654.1

84

2,413.8

124

3,199.2

5

1,286.6

45

1,671.3

85

2,478.6

125

3,261.1

6

1,320.4

46

1,692.1

86

2,478.4

126

3,250.2

7

1,349.8

47

1,716.3

87

2,491.1

127

3,264.6

8

1,356.0

48

1,754.9

88

2,491.0

128

3,219.0

9

1,369.2

49

1,777.9

89

2,545.6

129

3,170.4

10

1,365.9

50

1,796.4

90

2,595.1

130

3,179.9

11

1,378.2

51

1,813.1

91

2,622.1

131

3,154.5

12

1,406.8

52

1,810.1

92

2,671.3

132

3,159.3

13

1,431.4

53

1,834.6

93

2,734.0

133

3,186.6

14

1,444.9

54

1,860.0

94

2,741.0

134

3,258.3

15

1,438.2

55

1,892.5

95

2,738.3

135

3,306.4

16

1,426.6

56

1,906.1

96

2,762.8

136

3,365.1

17

1,406.8

57

1,948.7

97

2,747.4

137

3,451.7

18

1,401.2

58

1,965.4

98

2,755.2

138

3,498.0

19

1,418.0

59

1,985.2

99

2,719.3

139

3,520.6

20

1,438.8

60

1,993.7

100

2,695.4

140

3,535.2

21

1,469.6

61

2,036.9

101

2,642.7

141

3,577.5

22

1,485.7

62

2,066.4

102

2,669.6

142

3,599.2

23

1,505.5

63

2,099.3

103

2,714.9

143

3,635.8

24

1,518.7

64

2,147.6

104

2,752.7

144

3,662.4

25

1,515.7

65

2,190.1

105

2,804.4

145

2,721.1

26

1,522.6

66

2,195.8

106

2,816.9

146

3,704.6

27

1,523.7

67

2,218.3

107

2,828.6

147

3,712.4

28

1,540.6

68

2,229.2

108

2,856.8

148

3,733.6

29

1,553.3

69

2,241.8

109

2,896.0

149

3,781.2

30

1,552.4

70

2,255.2

110

2,942.7

150

3,820.3

31

1,561.5

71

2,287.7

111

3,001.8

151

3,858.9

32

1,537.3

72

2,300.6

112

2,994.1

152

3,920.7

33

1,506.1

73

2,327.3

113

3,020.5

153

3,970.2

34

1,514.2

74

2,366.9

114

3,115.9

154

4,005.8

35

1,550.0

75

2,385.3

115

3,142.6

155

4,032.1

36

1,586.7

76

2,383.0

116

3,181.6

156

4,059.3

37

1,606.4

77

2,416.5

117

3,181.7

157

4,095.7

38

1,637.0

78

2,419.8

118

3,178.7

158

4,112.2

39

1,629.5

79

2,433.2

119

3,207.4

159

4,129.7

40

1,643.4

80

2,423.5

120

3,201.3

160

4,133.2

Reprinted from Introductory Business & Economic Forecasting, 2nd Ed., Newbold, P. and Bos, T., Cincinnati, 1994, pp. 362-3.

Let’s plot the series:

As you can see, the series is on a steady, upward climb. The mean of the series appears to be changing, and moving upward; hence the series is likely not stationary. Let’s take a look at the ACF:

Wow! The ACF for the real GDP is in sharp contrast to our random series example above. Notice the lags: they are not cutting off. Each lag is quite strong. And the fact that most of them pierce the ±1.96 standard error line is clearly proof that the series is not white noise. Since the lags in the ACF are declining very slowly, that means that terms in the series are correlated several periods in the past. Because this series is not stationary, we must transform it into a stationary time series so that we can build a model with it.

Removing Nonstationarity: Differencing

The most common way to remove nonstationarity is to difference the time series. We talked about differencing in our discussion on correcting multicollinearity, and we mentioned quasi-differencing in our discussion on correcting autocorrelation. The concept is the same here. Differencing a series is pretty straightforward. We subtract the first value from the second, the second value from the third, and so forth. Subtracting a period’s value from its immediate subsequent period’s value is called first differencing. The formula for a first difference is given as:

 

Let’s try it with our series:

When we difference our series, our plot of the differenced data looks like this:

As you can see, the differenced series is much smoother, except towards the end where we have two points where real GDP dropped or increased sharply. The ACF looks much better too:

As you can see, only the first lag breaks through the ±1.96 standard errors line. Since it is only 5% of the lags displayed, we can conclude that the differenced series is stationary.

Second Order Differencing

Sometimes, first differencing doesn’t eliminate all nonstationarity, so a differencing must be performed on the differenced series. This is called second order differencing. Differencing can go on multiple times, but very rarely does an analyst need to go beyond second order differencing to achieve stationarity. The formula for second order differencing is as follows:

We won’t show an example of second order differencing in this post, and it is important to note that second order differencing is not to be confused with second differencing, which is to subtract the value two periods prior to the current period from the value of the current period. 

Seasonal Differencing

Seasonality can greatly affect a time series and make it appear nonstationary. As a result, the data set must be differenced for seasonality, very similar to seasonally adjusting a time series before performing a regression analysis. We will discuss seasonal differencing later in this ARIMA miniseries.

Recap

Before we can generate forecasts upon a time series, we must be sure our data set is stationary. Trend and seasonal components must be removed in order to generate accurate forecasts. We built on last week’s discussion of the autocorrelation function (ACF) to show how it could be used to detect stationarity – or the absence of it. When a data series is not stationary, one of the key ways to remove the nonstationarity is through differencing. The concept behind differencing is not unlike the other methods we’ve used in past discussions on forecasting: seasonal adjustment, seasonal dummy variables, lagging dependent variables, and time series decomposition.

Next Forecast Friday Topic: MA, AR, and ARMA Models

Our discussion of ARIMA models begins to hit critical mass with next week’s discussion on moving average (MA), autoregressive (AR), and autoregressive moving average (ARMA) models. This is where we begin the process of identifying the model to build for a dataset, and how to use the ACF and partial ACF (PACF) to determine whether an MA, AR, or ARMA model is the best fit for the data. That discussion will lay the foundation for our next three Forecast Friday discussions, where we delve deeply into ARIMA models.

 

*************************

What is your biggest gripe about using data? Tell us in our discussion on Facebook!

Is there a recurring issue about data analysis – or manipulation – that always seems to rear its ugly head?  What issues about data always seem to frustrate you?  What do you do about it?  Readers of Insight Central would love to know.  Join our discussion on Facebook. Simply go to our Facebook page and click on the “Discussion” tab and share your thoughts!   While you’re there, be sure to “Like” Analysights’ Facebook page so that you can always stay on top of the latest insights on marketing research, predictive modeling, and forecasting, and be aware of each new Insight Central post and discussions!  You can even follow us on Twitter!  So get this New Year off right and check us out on Facebook and Twitter!

Forecast Friday Topic: The Autocorrelation Function

January 6, 2011

(Thirty-fourth in a series)

Today, we begin a six-week discussion on the use of Autoregressive Integrated Moving Average (ARIMA) models in forecasting. ARIMA models were popularized by George Box and Gwilym Jenkins in the 1970s, and were traditionally known as Box-Jenkins analysis. The purpose of ARIMA methods is to fit a stochastic (randomly determined) model to a given set of time series data, such that the model can closely approximate the process that is actually generating the data.

There are three main steps in ARIMA methodology: identification, estimation and diagnostic checking, and then application. Before undertaking these steps, however, an analyst must be sure that the time series is stationary. That is, the covariance between any two values of the time series is dependent upon only the time interval between those particular values and not on their absolute location in time.

Determining whether a time series is stationary requires the use of an autocorrelation function (ACF), also called a correlogram, which is the topic of today’s post. Next Thursday, we will go into a full discussion on stationarity and how the ACF is used to determine whether a series is stationary.

Autocorrelation Revisited

Did someone say, “autocorrelation?” Yes! Remember our discussions about detecting and correcting autocorrelation in regression models in our July 29, 2010 and August 5, 2010 Forecast Friday posts? Recall that one of the ways we corrected for autocorrelation was by lagging the dependent variable by one period and then using the lagged variable as an independent variable. Anytime we lag a regression model’s dependent variable and then use it as an independent variable to predict a subsequent period’s dependent variable value, our regression model becomes an autoregressive model.

In regression analysis, we used autoregressive models to correct for autocorrelation. Yet, we can – and have – use the autoregression model to represent the behavior of the time series we’re observing.

When we lag a dependent variable by one period, our model is said to be a first-order autoregressive model. A first-order autoregressive model is denoted as:

Where φ1 is the parameter for the autoregressive term lagged by one period; at is the random variable with a mean of zero and constant variance at time period t; and C is a value that allows for the fact that time series Xt can have a nonzero mean. In fact, you can easily see that this formula mimics a regression equation, with at essentially becoming the residuals of the formula, Xt the dependent variable; C as alpha (or the intercept), and φ1Xt-1 as the independent variable. In essence, a first-order autoregressive model is forecasting the next period’s value on the most recent value.

What if you want to base next period’s forecast on the two most recent values? Then you lag by two periods, and have a second-order autoregressive model, which is denoted by:

In fact, you can use an infinite number of past periods to predict the next period. The formula below shows an autoregressive model of order p, where p is the number of past periods whose values on which you expect to predict the next period’s value:

This review of autocorrelation will help you out in the next session, when we begin to discuss the ACF.

The Autocorrelation Function (ACF)

The ACF is a plot of the autocorrelations between the data points in a time series, and is the key statistic in time series analysis. The ACF is the correlation of the time series with itself, lagged by a certain number of periods. The formula for each lag of an ACF is given by:

Where rk is the autocorrelation at lag k. If k=1, r1 shows the correlation between successive values of Y; if k=2, then r2 would denote the correlation between Y values two periods apart, and so on. Plotting each of these lags gives us our ACF.

Let’s assume we have 48 months of data, as shown in the following table:

Year 1

Year 2

Year 3

Year 4

Month

Value

Month

Value

Month

Value

Month

Value

1

1

13

41

25

18

37

51

2

20

14

63

26

93

38

20

3

31

15

17

27

80

39

65

4

8

16

96

28

36

40

45

5

40

17

68

29

4

41

87

6

41

18

27

30

23

42

68

7

46

19

41

31

81

43

36

8

89

20

17

32

47

44

31

9

72

21

26

33

61

45

79

10

45

22

75

34

27

46

7

11

81

23

63

35

13

47

95

12

93

24

93

36

25

48

37

 

As decision makers, we want to know whether this data series exhibits a pattern, and the ACF is the means to this end. If no pattern is discerned in this data series, then the series is said to be “white noise.” As you know from our regression analysis discussions our residuals must not exhibit a pattern. Hence, our residuals in regression analysis needed to be white noise. And as you will see in our later discussions on ARIMA methods, the residuals become very important in the estimation and diagnostic checking phase of the ARIMA methodology.

Sampling Distribution of Autocorrelations

Autocorrelations of a white noise series tend to have sampling distributions that are normally distributed, with a mean of zero and a standard error of 1/√n. The standard error is simply the reciprocal of the square root of the sample size. If the autocorrelations are white noise, approximately 95% of the autocorrelation coefficients will fall within two (actually, 1.96) standard errors of the mean; if they don’t, then the series is not white noise and a pattern does indeed exist.

To see if our ACF exhibits a pattern, we look at our individual rk values separately and develop a standard error formula to test whether each value for rk is statistically different from zero. We do this by plotting our ACF:

The ACF is the plot of lags (in blue) for the first 24 months of the series. The dashed red lines are the ±1.96 standard errors. If one or more lags pierce those dashed lines, then the lag(s) is significantly different from zero and the series is not white noise. As you can see, this series is white noise.

Specifically the values for the first six lags are:

Lag Value
r1

0.022

r2

0.098

r3

-0.049

r4

-0.036

r5

0.015

r6

-0.068

Apparently, there is no discernable pattern in the data: successive lags are only minimally correlated; in fact, there’s a higher correlation between lags two intervals apart.

Portmanteau Tests

In the example above, we looked at each individual lag. An alternative to this would be to examine a whole set of rk values, say the first 10 of them (r1 to r10) all at once and then test to see whether the set is significantly different from a zero set. Such a test is known as a portmanteau test, and the two most common are the Box-Pierce test and the Ljung-Box Q* statistic. We will discuss both of them here.

The Box-Pierce Test

Here is the Box-Pierce formula:

Q is the the Box-Pierce test statistic, which we will compare against the χ2 distribution; n is the total number of observations; h is the maximum lag we are considering (24 in the ACF plot).

Essentially, the Box-Pierce test indicates that if residuals are white noise, the Q-statistic follows a χ2 distribution with (h – m) degrees of freedom. If a model is fitted, then m is the number of parameters. However, no model is fitted here, so our m=0. If each rk value is close to zero, then Q will be very small; otherwise, if some rk values are large – either negatively or positively – then Q will be relatively large. We will compare Q to the χ2 distribution, just like any other significance test.

Since we plotted 24 lags, we are interested in only the r2k values for the first 24 observations (not shown). Our Q statistic is:

We have 24 degrees of freedom, and so we compare our Q statistic to the χ2 distribution. Our critical χ2 value for a 1% significance level is 42.98, well above our Q statistic, leading us to conclude that our chosen set of r2k values is not significantly different from a zero set.

The Ljung-Box Q* Statistic

In 1978, Ljung and Box believed there was a closer approximation to the χ2 distribution than the Box-Pierce Q statistic, so they developed the alternative Q* statistic. The formula for the Ljung-Box Q* statistic is:

For our r2k values, that is reflected in:

We get a Q* = 24.92. Comparing this to the same critical χ2 value, our distribution is still not significant. If the data are white noise, then the Q* and Q statistic will both have the same distribution. It’s important to note, however, that portmanteau tests have a tendency to fail in rejecting poorly fit models, so you shouldn’t rely solely on them for accepting models.

The Partial Autocorrelation Coefficient

When we do multiple regression analysis, we are sometimes interested in finding out how much explanatory power one variable has by itself. To do this, we omit the independent variable whose explanatory power we are interested in – or rather, partial out the effects of the other independent variables. We can do similarly in time series analysis, with the use of partial autocorrelations.

Partial autocorrelations measure the degree of association between various lags when the effects of other lags are removed. If the autocorrelation between Yt and Yt-1 is significant, then we will also see a similar significant autocorrelation between Yt-1 and Yt-2, as they are just one period apart. Since both Yt and Yt-2 are both correlated with Yt-1, they are also correlated with each other; so, by removing the effect of Yt-1, we can measure the true correlation between Yt and Yt-2.

A partial autocorrelation coefficient of order k, which is denoted by αk, is determined by regressing the current time series value by its lagged values:

As I mentioned earlier, this form of equation is an autoregressive (AR) one, since its independent variables are time-lagged values of the dependent variable. We use this multiple regression to find the partial autocorrelation αk. If we regress Yt only against Yt-1, then we derive our value for α1. If we regress Yt against both Yt-1 and Yt-2, then we’ll derive values for both α1 and α2.

Then, as we did for the autocorrelation coefficients, we plot our partial autocorrelation coefficients. This plot is called, not surprisingly, a partial autocorrelation function (PACF).

Let’s assume we wanted to measure the partial autocorrelations for the first 12 months of our data series. We generate the following PACF:

Since the lags fall within their 1.96 standard errors, our PACF is also indicative of a white noise series. Also, note that α1 in the PACF is always equal to r1 in the ACF.

Seasonality

Our data series exhibited no pattern, despite its monthly nature. This is unusual for many time series models, especially when you consider retail sales data. Monthly retail sales will exhibit a strong seasonal component, which will show up in your ACF at the time of the seasonal lag. The rk value at that particular lag will manifest itself as a lag that does indeed break through the critical value line, not only at that lag, but at also multiples of that lag. So, if sales are busiest in month 12, you can expect to see ACFs with significant lags at time 12, 24, 36, and so on. You’ll see examples of this in subsequent posts on ARIMA.

Next Forecast Friday Topic: Stationarity of Time Series Data

As mentioned earlier, a time series must be stationary for forecasting.  Next week, you’ll see how the ACF and PCF are used to determine whether a time series exhibits stationarity, as we move on towards our discussion of ARIMA methodology. 

*************************

Start the New Year on the Right Foot: Follow us on Facebook and Twitter !

For the latest insights on marketing research, predictive modeling, and forecasting, be sure to check out Analysights on Facebook and Twitter! “Like-ing” us on Facebook and following us on Twitter will allow you to stay informed of each new Insight Central post published, new information about analytics, discussions Analysights will be hosting, and other opportunities for feedback. So get this New Year off right and check us out on Facebook and Twitter!

Forecast Friday Topic: Calendar Effects in Forecasting

December 16, 2010

(Thirty-third in a series)

It is a common practice to compare a particular point in time to its equivalent one or two years ago. Companies often report their earnings and revenues for the first quarter of this year with respect to the first quarter of last year to see if there’s been any improvement or deterioration since then. Retailers want to know if December 2010 sales were higher or lower than December 2009 and even December 2008 sales. Sometimes, businesses want to see how sales compared for October, November, and December. While these approaches seem straightforward, the way the calendar falls can create misleading comparisons and faulty forecasts.

Every four years, February has 29 days instead of the usual 28. That extra day can cause problems in forecasting February sales. In some years, Easter falls in April, and other years March. This can cause forecasting nightmares for confectioners, greeting cards manufacturers, and retailers alike. In some years, a given month might have five Fridays and/or Saturdays, and just four in other years. If your business’ sales are much higher on the weekend, these can generate significant forecast error.

Adjusting for Month Length

Some months have as many as 31 days, others 30, while February 28 or 29. Because the variation in the calendar can cause variation in the time series, it is necessary to make adjustments. If you do not adjust for variation in the length of the month, the effects can show up as a seasonal effect, which may not cause serious forecast errors, but will certainly make it difficult to interpret any seasonal patterns. You can easily adjust for month length:

Where Wt is the weighted value of your dependent variable for that month. Hence, if you had sales of $100,000 in February and $110,000 in March, you would first start with the numerator. There’s 365.25 days in a (non-leap) year. Divide that by 12. That means the numerator will be 30.44. Divide that by the number of days in each of those months to get adjustment factors for each month. So, for February, you’d divide 30.44 by 28 and get an adjustment factor of 1.09; for March, you would divide by 31 and get an adjustment factor of .98. Then you would multiply those factors by their respective months. Hence, your weighted sales for February would be $109,000, and for March approximately $108,000. Although sales appear to be higher in March than in February, once you adjust for month length, you find that the two months actually were about the same in terms of volume.

Adjusting for Trading Days

As described earlier, months can have four or five occurrences of the same day. As a result, a month may have more trading days in one year than they do in the next. This can cause problems in retail sales and banking. If a month has five Sundays in it, and Sunday is a non-trading day (as is the case in banking) you must account for it. Unlike month-length adjustments, where differences in length from one month to the next are obvious, trading day adjustments aren’t always precise, as their variance is not as predictable.

In the simplest cases, your approach can be similar to that of the formula above, only you’re dividing the number of trading days in an average month by the number of trading days in a given month. However, that can be misleading.

Many analysts also rely on other approaches to adjust for trading days in regression analysis: seasonal dummy variables (which we discussed earlier this year); creating independent variables that denote the number of times each day of the week occurred in that month; and a dummy variable for Easter (having a value of 1 in either March or April, depending on when it fell, and 0 in the non-Easter month).

Adjusting for calendar and trading day effects is crucial to effective forecasting and discernment of seasonal patterns.

Forecast Friday Resumes January 6, 2011

Forecast Friday will not be published on December 23 and December 30, in observance of Christmas and New Year’s, but will resume on January 6, 2011. When we resume on that day, we will begin a six-week miniseries on autoregressive integrated moving average (ARIMA) models in forecasting. This six-week series will round out all of our discussions on quantitative forecasting techniques, after which we will begin discussing judgmental forecasts for five weeks, followed by a four week capstone tying together everything we’ve discussed. There’s much to look forward to in the New Year.

*************************

Be Sure to Follow us on Facebook and Twitter !

Thanks to all of you, Analysights now has over 200 fans on Facebook … and we’d love more! If you like Forecast Friday – or any of our other posts – then we want you to “Like” us on Facebook! And if you like us that much, please also pass these posts on to your friends who like forecasting and invite them to “Like” Analysights! By “Like-ing” us on Facebook, you and they will be informed every time a new blog post has been published, or when new information comes out. Check out our Facebook page! You can also follow us on Twitter. Thanks for your help!

Forecast Friday Topic: Double Exponential Smoothing

May 20, 2010

(Fifth in a series)

We pick up on our discussion of exponential smoothing methods, focusing today on double exponential smoothing. Single exponential smoothing, which we discussed in detail last week, is ideal when your time series is free of seasonal or trend components, which create patterns that your smoothing equation would miss due to lags. Single exponential smoothing produces forecasts that exceed actual results when the time series exhibits a decreasing linear trend, and forecasts that trail actual results when the time series exhibits an increasing trend. Double exponential smoothing takes care of this problem.

Two Smoothing Constants, Three Equations

Recall the equation for single exponential smoothing:

Ŷt+1 = αYt + (1-α) Ŷt

Where: Ŷt+1 represents the forecast value for period t + 1

Yt is the actual value of the current period, t

Ŷt is the forecast value for the current period, t

and α is the smoothing constant, or alpha, 0≤ α≤ 1

To account for a trend component in the time series, double exponential smoothing incorporates a second smoothing constant, beta, or β. Now, three equations must be used to create a forecast: one to smooth the time series, one to smooth the trend, and one to combine the two equations to arrive at the forecast:

Ct = αYt + (1-α)(Ct-1 + T t-1)

Tt = β(Ct – Ct-1) + (1 – β)T t-1

Ŷt+1 = Ct + Tt

All symbols appearing in the single exponential smoothing equation represent the same in the double exponential smoothing equation, but now β is the trend-smoothing constant (whereas α is the smoothing constant for a stationary – constant – process) also between 0 and 1; Ct is the smoothed constant process value for period t; and Tt is the smoothed trend value for period t.

As with single exponential smoothing, you must select starting values for Ct and Tt, as well as values for α and β. Recall that these processes are judgmental, and constants closer to a value of 1.0 are chosen when less smoothing is desired (and more weight placed on recent values) and constants closer to 0.0 when more smoothing is desired (and less weight placed on recent values).

An Example

Let’s assume you’ve got 12 months of sales data, shown in the table below:

Month t

Sales Yt

1

152

2

176

3

160

4

192

5

220

6

272

7

256

8

280

9

300

10

280

11

312

12

328

You want to see if there is any discernable trend, so you plot your sales on the chart below:

The time series exhibits an increasing trend. Hence, you must use double exponential smoothing. You must first select your initial values for C and T. One way to do that is to again assume that the first value is equal to its forecast. Using that as the starting point, you set C2 = Y1, or 152. Then you subtract Y1 from Y2 to get T2: T2 = Y2 – Y1 = 24. Hence, at the end of period 2, your forecast for period 3 is 176 (Ŷ3 = 152 + 24).

Now you need to choose α and β. For the purposes of this example, we will choose an α of 0.20 and a β of 0.30. Actual sales in period 3 were 160, and our constant-smoothing equation is:

C3 = 0.20(160) + (1 – 0.20)(152 + 24)

= 32 + 0.80(176)

= 32 + 140.8

= 172.8

Next, we compute the trend value with our trend-smoothing equation:

T3 = 0.30(172.8 – 152) + (1 – 0.30)(24)

= 0.30(20.8) + 0.70(24)

= 6.24 + 16.8

=23.04

Hence, our forecast for period 4 is:

Ŷ4 = 172.8 + 23.04

= 195.84

Then, carrying out your forecasts for the 12-month period, you get the following table:

     

Alpha=

0.2

Beta=

0.3

Month t

Sales Yt

Ct

Tt

Ŷt

Absolute Deviation

1

152

       

2

176

152.00

24.00

152.00

 

3

160

172.80

23.04

176.00

16.00

4

192

195.07

22.81

195.84

3.84

5

220

218.31

22.94

217.88

2.12

6

272

247.39

24.78

241.24

30.76

7

256

268.94

23.81

272.18

16.18

8

280

290.20

23.05

292.75

12.75

9

300

310.60

22.25

313.25

13.25

10

280

322.28

19.08

332.85

52.85

11

312

335.49

17.32

341.36

29.36

12

328

347.85

15.83

352.81

24.81

       

MAD=

20.19

 

Notice a couple of things: the absolute deviation is the absolute value of the difference between Yt (shown in lavender) and Ŷt (shown in light blue). Note also that beginning with period 3, Ŷ3 is really the sum of C and T computed in period 2. That’s because period 3’s constant and trend forecasts were generated at the end of period 2 – and onward until period 12. Mean Absolute Deviation has been computed for you. As with our explanation of single exponential smoothing, you need to experiment with the smoothing constants to find a balance that most accurate forecast at the lowest possible MAD.

Now, we need to forecast for period 13. That’s easy. Add C12 and T12:

Ŷ13 = 347.85 + 15.83

= 363.68

And, your chart comparing actual vs. forecasted sales is:

As with single exponential smoothing, you see that your forecasted curve is smoother than your actual curve. Notice also how small the gaps are between the actual and forecasted curves. The fit’s not bad.

Exponential Smoothing Recap

Now let’s recap our discussion on exponential smoothing:

  1. Exponential smoothing methods are recursive, that is, they rely on all observations in the time series. The weight on each observation diminishes exponentially the more distant in the past it is.
  2. Smoothing constants are used to assign weights – between 0 and 1 – to the most recent observations. The closer the constant is to 0, the more smoothing that occurs and the lighter the weight assigned to the most recent observation; the closer the constant is to 1, the less smoothing that occurs and the heavier the weight assigned to the most recent observation.
  3. When no discernable trend is exhibited in the data, single exponential smoothing is appropriate; when a trend is present in the time series, double exponential smoothing is necessary.
  4. Exponential smoothing methods require you to generate starting forecasts for the first period in the time series. Deciding on those initial forecasts, as well as on the values of your smoothing constants – alpha and beta – are arbitrary. You need to base your judgments on your experience in the business, as well as some experimentation.
  5. Exponential smoothing models do not forecast well when the time series pattern (e.g., level of sales) is suddenly, drastically, and permanently altered by some event or change of course or action. In these instances, a new model will be necessary.
  6. Exponential smoothing methods are best used for short-term forecasting.

Next Week’s Forecast Friday Topic: Regression Analysis (Our Series within the Series!)

Next week, we begin a multi-week discussion of regression analysis. We will be setting up the next few weeks with a discussion of the principles of ordinary least squares regression (OLS), and then discussions of its use as a time-series forecasting approach, and later as a causal/econometric approach. During the course of the next few Forecast Fridays, we will discuss the issues that occur with regression: specification bias, autocorrelation, heteroscedasticity, and multicollinearity, to name a few. There will be some discussions on how to detect – and correct – these violations. Once the regression analysis miniseries is complete, we will be set up to discuss ARMA and ARIMA models, which will be written by guest bloggers who are well-experienced in those approaches. We know you’ll be very pleased with the weeks ahead!

Still don’t know why our Forecast Friday posts appear on Thursday? Find out at: http://tinyurl.com/26cm6ma