Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 20 Time Series Analysis and Forecasting. Introduction Any variable that is measured over time in sequential order is called a time series. We.

Similar presentations


Presentation on theme: "Chapter 20 Time Series Analysis and Forecasting. Introduction Any variable that is measured over time in sequential order is called a time series. We."— Presentation transcript:

1 Chapter 20 Time Series Analysis and Forecasting

2 Introduction Any variable that is measured over time in sequential order is called a time series. We analyze time series to detect patterns. The patterns help in forecasting future values of the time series. t

3 Export for Sweden in the years 1993 -2004 Source:(www.scb.se)

4 Swedish Export

5 Earlier: Now: X 1t Y t X 2t Y t …. X kt Earlier values of Y

6 Components of a Time Series A time series can consist of four components. –Long - term trend (T). –Cyclical effect (C). –Seasonal effect (S). –Random variation (R).

7 A trend is a long term relatively smooth pattern or direction, that persists usually for more than one year.

8 A cycle is a wavelike pattern describing a long term behavior (for more than one year). Cycles are seldom regular, and often appear in combination with other components. 6/90 6/93 6/96 6/99 6/02

9 Components of a Time Series The seasonal component of the time series exhibits a short term (less than one year) calendar repetitive behavior. 6/97 12/97 6/98 12/98 6/99

10 We try to remove random variation thereby, identify the other components. Random variation comprises the irregular unpredictable changes in the time series. It tends to hide the other (more predictable) components.

11 Smoothing Techniques To produce a better forecast we need to determine which components are present in a time series. To identify the components present in the time series, we need first to remove the random variation. This can be done by smoothing techniques.

12 Moving Averages –A k-period moving average for time period t is the arithmetic average of the time series values around period t. –For example: A 3-period moving average at period t is calculated by (y t-1 + y t + y t+1 )/3

13 Dow Jones Index STOXX50E200520062007 January298536914211 February30583775 March30563854 April29303637 May30773649 June31823692 July33273809 August32643899 September34294005 October33203987 November34474120 December35794179 Dow Jones Index STOXX50E http://finance.yahoo.com

14 Dow Jones Index STOXX50E January 2005 - January 2007 http://finance.yahoo.com

15 Dow Jones Index STOXX50E 2005 January2985 February3058 March3056 April2930 May3077 June3182 July3327 August3264 September3429 October3320 November3447 December3579

16 Dow Jones Index STOXX50E Jan 2005 - Jan 2007 (Moving Average)

17 YtYt Three-term MAFive-term MA y1y1 ------------------- y2y2 (y 1 + y 2 + y 3 )/3----------- y3y3 (y 2 + y 3 + y 4 )/3(y 1 + y 2 + y 3 + y 4 + y 5 )/5 y4y4 (y 3 + y 4 + y 5 )/3(y 2 + y 3 + y 4 + y 5 + y 6 )/5 y5y5 (y 4 + y 5 + y 6 )/3(y 3 + y 4 + y 5 + y 6 + y 7 )/5 …... … ynyn --------

18 Centered Moving Average Period Sell ($ million)4-terms MA 4-terms centered MA 1170 2148 3141 4150 5161 6137 7132 8158 9157

19 Drawbacks –The moving average method does not provide smoothed values (moving average values) for the first and last set of periods. –T he moving average method considers only the observations included in the calculation of the average value, and “forgets” the rest.

20 Exponentially Smoothed Time Series S t = exponentially smoothed time series at time t. y t = time series at time t. S t-1 = exponentially smoothed time series at time t-1. w = smoothing constant, where 0  w  1. S t = w y t + (1- w )S t-1

21 The exponential smoothing method provides smoothed values for all the time periods observed. When smoothing the time series at time t, the exponential smoothing method considers all the data available at t (y t, y t-1,…).

22 Small ‘w’ provides a lot of smoothing Big ‘w’ provides a little smoothing

23 Trend and Seasonal Effects Trend Analysis The trend component of a time series can be linear or non-linear. It is easy to isolate the trend component using linear regression. –For linear trend use the model y =  0 +  1 t +  –For non-linear trend with one (major) change in slope use a polynomial model, for exampley =  0 +  1 t +  2 t 2 + 

24 Trend analysis The purpose is to Describe the trend component in order to make forecasts Detrend the time series in order to make a season analysis.

25 Seasonal Analysis Seasonal variation may occur within a year or within a shorter period (month, week) To measure the seasonal effects we construct seasonal indexes. Seasonal indexes express the degree to which the seasons differ from the average time series value across all seasons.

26 Computing Seasonal Indexes Remove the effects of the seasonal and random variations by regression analysis = b 0 + b 1 t For each time period compute the ratio y t /y t which removes most of the trend variation > For each season calculate the average of y t /y t which provides the measure of seasonality. Adjust the average above so that the sum of averages of all seasons is 1 (if necessary) > This is based on the Multiplicative Model. Multiplicative Model.

27 Source for the following example http://www.economagic.com/em- cgi/data.exe/doeme/txrcbushttp://www.economagic.com/em- cgi/data.exe/doeme/txrcbus 1 Btu ≈ 1 055 joules British thermal unit

28 Computing Seasonal Indexes Calculate the quarterly seasonal indexes for Residential Primary Energy Consumption (in Trillion Btu) in order to measure seasonal variation.

29 Plot the data!

30 Computing Seasonal Indexes Perform regression analysis for the model y =  0 +  1 t +  where t represents the time, and y represents the occupancy rate. Time (t) Btu 1 3102 2 1221 3 821 4 1756 5 2803 6 1273 7 800 8 2078.. The regression line represents trend.

31 t y t Ratio 1310218783102/1878=1.65 2122118651221/1865=0.66 3…………………………………………………. No trend is observed, but seasonality and randomness still exist. =1890.219-12.583(1) The Ratios y t  y t >

32 The Average Ratios by Seasons (1.65+ 1.53 + 1.81+ 1.78+ 1.78)/5 = 1.71Average ratio for quarter 1: To remove most of the random variation but leave the seasonal effects,average the terms for each season.

33 Average ratio for quarter 2: (0.65+0.70+0.74+0.70+0.76)/5 = 0.71 Average ratio for quarter 3: (0.44+0.44+0.47+0.48+0.50)/5 = 0.47 Average ratio for quarter 4: (0.95+1.16+1.11+1.15+1.17)/ 5 = 1.11

34 In this example the sum of all the averaged ratios must be 4, such that the average ratio per season is equal to 1. If the sum of all the ratios is not 4, we need to adjust them proportionately. In our problem the sum of all the averaged ratios is equal to 4: 1.71+ 0.71 + 0.47 + 1.11 = 4.0. No normalization is needed. These ratios become the seasonal indexes. Suppose the sum of ratios is equal to 4.1. Then each ratio will be multiplied by 4/4.1. Adjusting the Average Ratios

35 The seasonal indexes tell us what is the ratio between the time series value at a certain season, and the overall seasonal average. In our problem: Q11.7171% above the annual average Q20.7129% below the annual average Q30.4753% above the annual average Q41.1111% above the annual average Interpreting the Seasonal Indexes

36 The trend component and the seasonality component are recomposed using the multiplicative model. This is used for forecasting. Quarter 1, 2001: Quarter 2, 2001: The Smoothed Time Series

37 Seasonal analysis The purpose is to Describe the seasonal component in order to make forecasts Deseasonalize the time series (makes it for example easier to compare timeseries over seasons)

38 Deseasonalized Time Series By removing the seasonality, we can identify changes in the other components of the time series, that might have occurred over time. Seasonally adjusted time series = Actual time series Seasonal index

39 Deseasonalized Time Series In period #1 ( quarter 1): In period #2 ( quarter 2): In period #5 ( quarter 1):

40 We can also use indicator variables in order to analyze the seasonal effects. QuarterI1I1 I2I2 I3I3 1100 2010 3001 4000


Download ppt "Chapter 20 Time Series Analysis and Forecasting. Introduction Any variable that is measured over time in sequential order is called a time series. We."

Similar presentations


Ads by Google