Presentation is loading. Please wait.

Presentation is loading. Please wait.

Time Series Forecasting

Similar presentations


Presentation on theme: "Time Series Forecasting"— Presentation transcript:

1 Time Series Forecasting
Chapter 16 Time Series Forecasting

2 Time Series Forecasting
16.1 Time Series Components and Models 16.2 Time Series Regression: Basic Models 16.3 Time Series Regression: More Advanced Models (Optional) 16.4 Multiplicative Decomposition

3 Time Series Forecasting
16.5 Simple Exponential Smoothing 16.6 Holt-Winter’s Models 16.7 Forecast Error Comparisons 16.8 Index Numbers

4 Time Series Components and Models
Trend Long-run growth or decline Cycle Long-run up and down fluctuation around the trend level Seasonal Regular periodic up and down movements that repeat within the calendar year Irregular Erratic very short-run movements that follow no regular pattern

5 Trend

6 Cycle

7 Seasonal Variation

8 No Trend When there is no trend, the least squares point estimate b0 of b0 is just the average y value yt = b0 + et That is, we have a horizontal line that crosses the y axis at its average value

9 Example 16.1: The Cod Catch Case
Bay City Seafood Co. operates fishing trawlers and a fish processing plant Wishes to forecast its minimum and maximum possible revenues Wishes to make point estimate and prediction interval forecast of monthly cod catch

10 Example 16.1: Cod Catch (In Tons)
Month Year 1 Year 2 January 362 276 February 381 334 March 317 394 April 297 May 309 384 June 402 314 July 375 344 August 349 337 September 386 345 October 328 November 389 December 343 365

11 Example 16.1: Plot of Cod Catch versus Time

12 Example 16.1: The Cod Catch Case #4
Company believes this data pattern will continue It seems reasonable to use the “no trend” regression model yt = β0 + εt Point estimate of b0 is y̅ ŷ = εt

13 Example 16.1: The Cod Catch Case #5
A prediction interval for the “no trend” model is t/2 is based on n-1 degrees of freedom A 95 percent prediction interval is:

14 Trend When sales increase (or decrease) over time, we have a trend
Oftentimes, that trend is linear in nature Linear trend is modeled using regression Sales is the dependent variable Time is the independent variable Weeks · Months Quarters · Years Not only is simple linear regression used, quadratic regression is sometimes used

15 Example 16.2: Calculator Sales Case
For two years, Smith’s Department Sore has carried a Bismark X-12 calculator Sales are increasing Smith’s wishes to forecast demand Both point estimate and prediction interval

16 Example 16.2: Calculator Sales Data
Month Year 1 Year 2 January 197 296 February 211 276 March 203 305 April 247 308 May 239 356 June 269 393 July 363 August 262 386 September 258 443 October 256 November 261 358 December 288 384

17 Example 16.2: Plot of Calculator Sales versus Time

18 Example 16.2: The Calculator Sales Case #4
Smith’s believes the trend will continue Reasonable to use the “linear trend” regression model yt = β0 + β1t + εt y25 = (25) = y26 = (26) = 408.0 An software package can show the prediction intervals are [328.6,471.2] and [336.0,479.9] respectively

19 Seasonality Some products have demand that varies a great deal by period Coats Bathing suits Bicycles This periodic variation is called seasonality Seasonality alters the linear relationship between time and demand

20 Types of Seasonality Constant seasonal variation is where the magnitude of the swing does not depend on the level of the time series Increasing seasonal variation is where the magnitude of the swing increases as the level of the time series increases

21 Modeling Seasonality Within regression, seasonality can be modeled using dummy variables Consider the model: yt = b0 + b1t + bQ2Q2 + bQ3Q3 + bQ4Q4 + et For Quarter 1, Q2 = 0, Q3 = 0 and Q4 = 0 For Quarter 2, Q2 = 1, Q3 = 0 and Q4 = 0 For Quarter 3, Q2 = 0, Q3 = 1 and Q4 = 0 For Quarter 4, Q2 = 0, Q3 = 0 and Q4 = 1 The b coefficient will then give us the seasonal impact of that quarter relative to Quarter 1 Negative means lower sales, positive lower sales

22 Example 16.3: The Bike Sales Case
A bicycle shop in Switzerland has sold the TRK-50 mountain bike for four years Wish to describe sales using a regression model

23 Example 16.3: Quarterly Sales Data
Year Quarter t Sales 1 10 3 9 13 2 31 34 43 11 48 4 16 12 19 5 15 6 33 14 37 7 45 51 8 17 21

24 Example 16.3: MINITAB Plot of Bike Sales

25 Example 16.3: MINITAB Output of Dummy Variable Regression

26 Example 16.3: The Bike Sales Case #5
ŷ17 = b0 + b1(17) + bQ2(0) + bQ3(0) + bQ4(0) ŷ17 = (17) = ŷ18 = b0 + b1(18) + bQ2(1) + bQ3(0) + bQ4(0) ŷ18 = (18) + 21 = ŷ19 = b0 + b1(19) + bQ2(0) + bQ3(1) + bQ4(0) ŷ19 = (19) = ŷ20 = b0 + b1(20) + bQ2(0) + bQ3(0) + bQ4(1) ŷ20 = (20) =

27 Time Series Regression: More Advanced Models
Sometimes, transforming the sales data makes it easier to forecast Square root Quartic roots Natural logarithms While these transformations can make the forecasting easier, they make it harder to understand the resulting model

28 Example 16.4: Traveler’s Rest Case #1
Seasonal Regression

29 Example 16.4: MegaStat Regression Output

30 Example 16.4: MegaStat Output of Predicted Values

31 Autocorrelation One of the assumptions of regression is that the error terms are independent With time series data, that assumption is often violated Positive or negative autocorrelation is common One type of autocorrelation is first-order autocorrelation

32 First-Order Autocorrelation
Error term in time period t is related to the one in t-1 t = φt-1 + at φ is the correlation coefficient that measures the relationship between the error terms at is an error term, often called a random shock

33 Autocorrelation Continued
We can test for first-order correlation using Durbin-Watson Covered in Chapter 15 One approach to dealing with first-order correlation is predict future values of the error term using the model et = φet-1 + at

34 Autoregressive Model The error term et can be related to more than just the previous error term et-1 This is often the case with seasonal data Autoregressive error term model of order q: t = φt-1 + φt-2 + … + φt-q + at relates the error term to any number of past error terms The Box-Jenkins methodology can be used to systematically build a model that relates t to an appropriate number of past error terms

35 Multiplicative Decomposition
We can use the multiplicative decomposition method to decompose a time series into its components: Trend Seasonal Cyclical Irregular

36 Steps to Multiplicative Decomposition #1
Compute a moving average This eliminates the seasonality Averaging period matches seasonal period

37 Steps to Multiplicative Decomposition #2
Compute a two-period centering moving average The average from Step 1 needs to be matched up with a specific period Consider a 4-period moving average The average of 1, 2, 3 and 4 is 2.5 This does not match any period The average of 2.5 and the next term 3.5 is 3 This matches up with period 3 Step 2 not needed if Step 1 uses odd number of periods

38 Steps to Multiplicative Decomposition #3
The original demand for each period is divided by the value computed in Step 2 for that same period The first and last few period do not have a value from Step 2 These periods are skipped All of the values from Step 3 for season 1 are averaged together to form seasonal factor for season 1 This is repeated for every season If there are four seasons, there will be four factors

39 Steps to Multiplicative Decomposition #4
The original demand for each period is divided by the appropriate seasonal factor for that period This gives us the deseasonalized observation A forecast is prepared using the deseasonalized observations This is usually simple regression The deseasonalized forecast for each period from Step 6 is multiplied by the appropriate seasonal factor for that period This returns seasonality to the forecast

40 Steps to Multiplicative Decomposition #5
We estimate the period-by-period cyclical and irregular component by dividing the deseasonalized observation from Step 5 by the deseasonalized forecast from Step 6 We use a three-period moving average to average out the irregular component The value from Step 9 divided by the value from Step 8 gives us the cyclical component Values close to one indicate a small cyclical component We are interested in long-term patterns

41 Example 16.5: The Tasty Cola Case
Discount Soda Shop owns ten drive-in soft drink scores Have been selling Tasty Cola for three years They wish to forecast monthly demand Data has seasonal variation

42 Example 16.5: Monthly Sales of Tasty Cola (In Hundreds of Cases)
Year Month t Sales 1 189 2 7 19 831 229 8 20 960 3 249 9 21 1,152 4 289 10 22 759 5 260 11 23 607 6 431 12 24 371 660 25 298 777 26 378 915 27 373 613 28 443 485 29 374 277 30 13 244 31 1,004 14 296 32 1,153 15 319 33 1,388 16 370 34 904 17 313 35 715 18 556 36 441

43 Example 16.5: Monthly Sales of Tasty Cola Graphically

44 Example 16.5: The Tasty Cola Case #4
Seasonal variation seems to be increasing It is reasonable to use the multiplicative model yt = TRt x SNt x CLt x IRt TRt x SNt x CLt x IRt represent the trend, seasonal, cyclical, and irregular components in time period t

45 Example 16.5: Estimation of the Seasonal Factors

46 Example 16.5: Plot of Tasty Cola Sales and Deseasonalized Data

47 Example 16.5: Forecasts of Future Values of Tasty Cola Sales

48 Example 16.5: A Plot of the Observed and Forecast Tasty Cola Sales

49 Simple Exponential Smoothing
Earlier, we saw that when there is no trend, the least squares point estimate b0 of β0 is just the average y value yt = β0 + t That gave us a horizontal line that crosses the y axis at its average value Since we estimate b0 using regression, each period is weighted the same If β0 is slowly changing over time, we want to weight more recent periods heavier Exponential smoothing does just this

50 Exponential Smoothing Continued
Exponential smoothing takes on the form: ST = yT + (1 – )ST-1 Alpha is a smoothing constant between zero and one Alpha is typically between 0.02 and 0.30 Smaller values of alpha represent slower change We want to test the data and find an alpha value that minimizes the sum of squared forecast errors

51 Example 16.6: The Cod Catch Case
Example 16.1 suggested that the no trend model may approximate the cod catch series It is also possible that β0 is slowly changing over time Will estimate β0 using first six observations Denoted as S0 After of first six periods S0 =

52 Example 16.6: The Cod Catch Case #2
Assume that at the end of T-1, we have ST-1 to estimate β0 Assume that in T, we obtain a new observation yT, we can update ST-1 to ST We compute the updated estimate using the smoothing equation ST = yT + (1-)ST-1  is between zero and one

53 Example 16.6: One-Period-Ahead Forecast Using Exponential Smoothing

54 Example 16.7: The Cod Catch Case
Example 16.6 showed that =0.02 was a good value We can use =0.02 to forecast future monthly cod catches Example 16.6 estimated S24=356.13 The point forecast made in month 24 of any future monthly cod catch is

55 Example 16.7: The Cod Catch Case #2
Assume the cod catch in January of year 3 is y25=384 S25 = y25 + (1-)S24 S25 = 0.02(384) (356.13) = is the point forecast made in month 25 for any future monthly cod catch

56 Example 16.7: MINITAB Output of Using Exponential Smoothing to Forecast Cod

57 Holt–Winters’ Models Simple exponential smoothing cannot handle trend or seasonality Holt–Winters’ double exponential smoothing can handle trended data of the form yt = β0 + β1t + t Assumes β0 and β1 changing slowly over time We first find initial estimates of β0 and β1 Then use updating equations to track changes over time Requires smoothing constants called alpha and gamma Updating equations in Appendix K of the CD-ROM

58 Multiplicative Winters’ Method
Double exponential smoothing cannot handle seasonality Multiplicative Winters’ method can handle trended data of the form yt = (β0 + β1t) · SNt + t Assumes β0, β1, and SNt changing slowly over time We first find initial estimates of β0 and β1 and seasonal factors Then use updating equations to track over time Requires smoothing constants alpha, gamma and delta Updating equations in Appendix K of the CD-ROM

59 MINITAB Output of Double Exponential Smoothing for Calculator Sales Data

60 MINITAB Output of Double Exponential Smoothing for Calculator Sales Data

61 MINITAB Output of Graphical Forecasts When =0.496 and ƴ=0.142

62 MINITAB Output Using Winters’ Method to Forecast Tasty Cola Sales

63 Forecast Error Comparison
Forecast errors: et = yt - ŷt Error comparison criteria Mean absolute deviation (MAD) Mean squared deviation (MSD)

64 Example: The Tasty Cola Case

65 Index Numbers Index numbers allow us to compare changes in time series over time We begin by selecting a base period Every period is converted to an index by dividing its value by the base period and then multiplying the results by 100 Simple (quantity) index

66 Example: Installment Credit
Installment Credit Outstanding (in billions of dollars):

67 Aggregate Price Index Often wish to compare a group of items
To do this, we compute the total prices of the items over time We then index this total Aggregate price index

68 Example: Market Basket of Groceries

69 Weighted Aggregate Price Index
An aggregate price index assumes all items in the basket are purchased with the same frequency A weighted aggregate price index takes into account varying purchasing frequency The Laspeyres index assumes the same mixture of items for all periods as was used in the base period The Paasche index allows the mixture of items in the basket to change over time as purchasing habits change

70 Example: Laspeyres Index
(base quantity weights) 1992 (base) and 1997 Prices for a Market Basket of Grocery Items

71 Example: Paasche Index
(current quantity weights) 1992 (base) and 1997 Prices for a Market Basket of Grocery Items


Download ppt "Time Series Forecasting"

Similar presentations


Ads by Google