SESSION 53 - 56

20
SESSION 53 - 56 Last Update 18 th June 2011 Time Series Forecasting

description

SESSION 53 - 56. Last Update 18 th June 2011. Time Series Forecasting. Learning Objectives. Forecasting Time Series Analysis Time Series Forecasting – Linear Trend without Seasonality Time Series Forecasting – Linear Trend with Seasonality. Forecasting - Methodologies. - PowerPoint PPT Presentation

Transcript of SESSION 53 - 56

Page 1: SESSION 53 - 56

SESSION 53 - 56

Last Update18th June 2011

Time Series Forecasting

Page 2: SESSION 53 - 56

Lecturer: Florian BoehlandtUniversity: University of Stellenbosch Business SchoolDomain: http://www.hedge-fund-analysis.net/pages/v

ega.php

Page 3: SESSION 53 - 56

Learning Objectives

1. Forecasting2. Time Series Analysis3. Time Series Forecasting – Linear Trend

without Seasonality4. Time Series Forecasting – Linear Trend with

Seasonality

Page 4: SESSION 53 - 56

Forecasting - Methodologies

• Qualitative Methods: Here forecasting is based on intuition, estimates and opinions, typically from the sales force, customers or senior management. Such methods are frequently termed subjective or judgmental.

• Causal or Econometric Methods: Forecasting methods that establish causal relationships, such as in regression analysis. For example a motorcar manufacturer would base its demand forecasts on predictions of causal factors such as a) the interest rate, b) price of fuel, c) competitor pricing, d) business confidence indices, e) national income level, etc.

• Time Series Methods: These methods are based on the idea that prior occurrences can be used to predict the future, through a process of extrapolation.

Page 5: SESSION 53 - 56

Time Series Analysis - Definitions

Time series analysis/decomposition breaks-down (decomposes) a time series into its constituent components in order to understand the structure of its pattern. There are four components to a time series:•Secular trend (T) – underlying tendency for the time series to rise (or fall) over time.•Seasonal variation (S) – regular rhythmic pattern e.g. month-end & Christmas sales.•Cyclical variation (C) – a multi-year oscillation due to macro economic or industry level activity. •Irregular variation (I) – unpredictable variations such as a plant breakdown, a strike, etc.These four components may possess an additive or multiplicative relationship:

Page 6: SESSION 53 - 56

Example Linear Trend – No Seasonality

The table to the left displays the sales of Gold Tomato Sauce glass bottles in ‘000s.

Is it possible to predict the future values of the time series for the year 2011 taking into consideration the past trend?

The method employed isignoring seasonal, cyclical or irregular variation.

Year y2007 512008 682009 992010 132

Total 4 350

Page 7: SESSION 53 - 56

Plotting Time Series

Page 8: SESSION 53 - 56

Guide to Time Series Forecasting excluding Seasonality

1. Set x values for each time period according to the zero-sum of x rules2. Compute all x2 and xy values and sum them3. Find the equation of the line: a + b (x)4. Use the result of step 3 to compute trend values for each time period5. Set future values of x6. Calculate y using the future value of x and equation a + b (x)

Page 9: SESSION 53 - 56

Step 1 + 2: Set x-Values and compute x2 and xy

Year y x x^2 xy2007 51 -3 9 -1532008 68 -1 1 -682009 99 1 1 992010 132 3 9 396

Total 4 350 20 274

If n is even:

If n is odd:

Page 10: SESSION 53 - 56

Step 3 + 4: Determine (T)rend (a+bx)

(T)rendYear y x x^2 xy a+bx2007 51 -3 9 -153 46.42008 68 -1 1 -68 73.82009 99 1 1 99 101.22010 132 3 9 396 128.6

Total 4 350 20 274

a 87.5b 13.7

Page 11: SESSION 53 - 56

Step 5 + 6: Set future values of x and estimate y-hat

(T)rendYear y x x^2 xy a+bx2007 51 -3 9 -153 46.42008 68 -1 1 -68 73.82009 99 1 1 99 101.22010 132 3 9 396 128.6

Total 4 350 20 274y x

2011 156 5

a 87.5b 13.7

Page 12: SESSION 53 - 56

Chart Forecast

Page 13: SESSION 53 - 56

Example Linear Trend - Quarterly Seasonality

SALESTotal Quarter y

1997 2653 Q1 210Q2 656Q3 1319Q4 468

1998 3643 Q1 332Q2 988Q3 1738Q4 585

1999 4769 Q1 461Q2 1222Q3 2272Q4 814

Total 12 11065

The table to the left displays an example for the quarterly values of a time series for three consecutive years. It is easy to see that the observed values fluctuate depending on the current quarter.

Is it possible to predict the future values of the time series for the year 2000 taking into consideration the quarterly fluctuation?

The method employed isignoring cyclical or irregular variation.

Page 14: SESSION 53 - 56

Plotting Time Series

Page 15: SESSION 53 - 56

Guide to Time Series Forecasting including Seasonality

1. Set x values for each time period according to the zero-sum of x rules2. Compute all x2 and xy values and sum them3. Find the equation of the line: a + b (x)4. Use the result of step 3 to compute trend values for each time period5. Compute the deviation of actual values from trend values (y / T)6. Find the average deviation per time period (e.g. quarter). Adjust values to

∑= 4.7. Set future values of x8. Determine the future trend values9. Input the seasonality values calculated in step 610. Finalise the sales forecast by multiplying the quarterly trend values by

the quarterly seasonality values

Page 16: SESSION 53 - 56

Step 1 + 2: Set x-Values and compute x2 and xy

SALESTotal Quarter y i x x^2 xy

1997 2653 Q1 210 1 -11 121 -2310Q2 656 2 -9 81 -5904Q3 1319 3 -7 49 -9233Q4 468 4 -5 25 -2340

1998 3643 Q1 332 5 -3 9 -996Q2 988 6 -1 1 -988Q3 1738 7 1 1 1738Q4 585 8 3 9 1755

1999 4769 Q1 461 9 5 25 2305Q2 1222 10 7 49 8554Q3 2272 11 9 81 20448Q4 814 12 11 121 8954

Total 12 11065 572 21983

If n is even:

If n is odd:

Page 17: SESSION 53 - 56

Step 3 to 5: Determine (T)rend (a+bx) and compute deviation

SALES (T)RENDTotal Quarter y i x x^2 xy a+bx y/T

1997 2653 Q1 210 1 -11 121 -2310 499.333 0.421Q2 656 2 -9 81 -5904 576.197 1.138Q3 1319 3 -7 49 -9233 653.061 2.020Q4 468 4 -5 25 -2340 729.924 0.641

1998 3643 Q1 332 5 -3 9 -996 806.788 0.412Q2 988 6 -1 1 -988 883.652 1.118Q3 1738 7 1 1 1738 960.515 1.809Q4 585 8 3 9 1755 1037.379 0.564

1999 4769 Q1 461 9 5 25 2305 1114.242 0.414Q2 1222 10 7 49 8554 1191.106 1.026Q3 2272 11 9 81 20448 1267.970 1.792Q4 814 12 11 121 8954 1344.833 0.605

Total 12 11065 572 21983 922.083

a 922.083b 38.432

Page 18: SESSION 53 - 56

Step 6: Find average deviation and adjust to ∑4

SALES (T)RENDTotal Quarter y Obs x x^2 xy a+bx y/T

1997 2653 Q1 210 1 -11 121 -2310 499.333 0.421Q2 656 2 -9 81 -5904 576.197 1.138Q3 1319 3 -7 49 -9233 653.061 2.020Q4 468 4 -5 25 -2340 729.924 0.641

1998 3643 Q1 332 5 -3 9 -996 806.788 0.412Q2 988 6 -1 1 -988 883.652 1.118Q3 1738 7 1 1 1738 960.515 1.809Q4 585 8 3 9 1755 1037.379 0.564

1999 4769 Q1 461 9 5 25 2305 1114.242 0.414Q2 1222 10 7 49 8554 1191.106 1.026Q3 2272 11 9 81 20448 1267.970 1.792Q4 814 12 11 121 8954 1344.833 0.605

Total 12 11065 572 21983 922.083Adjusted Average Q

to ∑4 Deviation0.417 0.4151.098 1.0941.880 1.8740.605 0.603

Total 4.000 3.987

Averages across quarters:

Rescale to the base of 4:

Page 19: SESSION 53 - 56

Step 7 to 10: Set future values of x and estimate y-hat

SALES (T)RENDTotal Quarter y Obs x x^2 xy a+bx y/T

1997 2653 Q1 210 1 -11 121 -2310 499.333 0.421Q2 656 2 -9 81 -5904 576.197 1.138Q3 1319 3 -7 49 -9233 653.061 2.020Q4 468 4 -5 25 -2340 729.924 0.641

1998 3643 Q1 332 5 -3 9 -996 806.788 0.412Q2 988 6 -1 1 -988 883.652 1.118Q3 1738 7 1 1 1738 960.515 1.809Q4 585 8 3 9 1755 1037.379 0.564

1999 4769 Q1 461 9 5 25 2305 1114.242 0.414Q2 1222 10 7 49 8554 1191.106 1.026Q3 2272 11 9 81 20448 1267.970 1.792Q4 814 12 11 121 8954 1344.833 0.605

Total 12 11065 572 21983 922.083(T)REND Adjusted Average Q

y x a+bx to ∑4 Deviation2000 6199.798 Q1 592.374 13 1421.697 0.417 0.415

Q2 1645.213 15 1498.561 1.098 1.094Q3 2961.771 17 1575.424 1.880 1.874Q4 1000.440 19 1652.288 0.605 0.603

Total 4.000 3.987a 922.083b 38.432

Trend for 2000:

Estimate for y:

Page 20: SESSION 53 - 56

Chart Forecast