time series, forecasting, and index numbers
TRANSCRIPT
Slide 1
Time Series, Forecasting, and Index Numbers By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer
Shakeel NoumanM.Phil Statistics
Time Series, Forecasting, and Index Numbers
Slide 2
• Using Statistics• Trend Analysis• Seasonality and Cyclical Behavior• The Ratio-to-Moving-Average Method• Exponential Smoothing Methods• Index Numbers• Summary and Review of Terms
Time Series, Forecasting, and Index Numbers12
Time Series, Forecasting, and Index Numbers By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer
Slide 3
A time series is a set of measurements of a variable that are ordered through time. Time series analysis attempts to detect and understand regularity in the fluctuation of data over time.
Regular movement of time series data may result from a tendency to increase or decrease through time - trend- or from a tendency to follow some cyclical pattern through time - seasonality or cyclical variation.
Forecasting is the extrapolation of series values beyond the region of the estimation data. Regular variation of a time series can be forecast, while random variation cannot.
12-1 Using Statistics
Time Series, Forecasting, and Index Numbers By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer
Slide 4
A random walk:Zt- Zt-1=at
or equivalently: Zt= Zt-1+at
The difference between Z in time t and time t-1 is a random error.
5 0403020100
15
10
5
0
t
Z
Random Walk
a
There is no evident regularity in a random walk, since the difference in the series from period to period is a random error. A random walk is not forecastable.
The Random Walk
Time Series, Forecasting, and Index Numbers By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer
Slide 5
A Time Series as a Superposition of Two Wave Functions and a Random Error (not shown)
5 04 03 02 01 00
4
3
2
1
0
-1
t
z
In contrast with a random walk, this series exhibits obvious cyclical fluctuation. The underlying cyclical series - the
regular elements of the overall fluctuation - may be analyzable and forecastable.
A Time Series as a Superposition of Cyclical
Functions
Time Series, Forecasting, and Index Numbers By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer
Slide 612-2 Trend Analysis: Example
12-1
The following output was obtained using the template.
Zt = 696.89 + 109.19t
Note: The template contains forecasts for t = 9 to t = 20 which corresponds to years 2002 to 2013.
Time Series, Forecasting, and Index Numbers By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer
Slide 712-2 Trend Analysis: Example
12-1
Straight line trend.
Time Series, Forecasting, and Index Numbers By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer
Slide 8
Example 12-2
Observe that the forecast model is Zt = 82.96 + 26.23t
The forecast for t = 10
(year 2002) is 345.27
Time Series, Forecasting, and Index Numbers By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer
Slide 9
888786
11000
10000
9000
8000
7000
6000 t
Pas
s en g
ers
Monthly Numbers of Airline Pas sengers
89 90 91 92 93 94 9595949392919089888786858483828180
20
15
10
5
Ye ar
Ea
r nin
gs
G ro s s E arning s : Annual
AJJMAMFJDNOSAJJMAMFJDNOSAJJMAMFJ
200
100
0
Time
Sal
es
Monthly S ale s of S untan Oil
When a cyclical pattern has a period of one year, it is usually called seasonal variation. A pattern with a period of other than one year is called cyclical variation.
12-3 Seasonality and Cyclical Behavior
Time Series, Forecasting, and Index Numbers By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer
Slide 10
• Types of VariationTrend (T)Seasonal (S)Cyclical (C)Random or Irregular (I)
• Additive ModelZt = Tt + St + Ct + It
• Multiplicative ModelZt = (Tt )(St )(Ct )(It)
Time Series Decomposition
Time Series, Forecasting, and Index Numbers By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer
Slide 11
An additive regression model with seasonality:
Zt=0+ 1 t+ 2 Q1+ 3 Q2 + 4 Q3 + at
where Q1=1 if the observation is in the first quarter, and 0
otherwise Q2=1 if the observation is in the second quarter,
and 0 otherwise Q3=1 if the observation is in the third quarter, and
0 otherwise
Estimating an Additive Model with Seasonality
Time Series, Forecasting, and Index Numbers By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer
Slide 12
A moving average of a time series is an average of a fixed number of observations that moves as we progress down the
series.
Time, t: 1 2 3 4 5 6 7 8 9 10 11 12 13 14Series, Zt: 15 12 11 18 21 16 14 17 20 18 21 16 14 19
Five-periodmoving average: 15.4 15.6 16.0 17.2 17.6 17.0 18.0 18.4 17.8 17.6
Time, t: 1 2 3 4 5 6 7 8 9 10 11 12 13 14Series, Zt: 15 12 11 18 21 16 14 17 20 18 21 16 14 19
(15 + 12 + 11 + 18 + 21)/5=15.4 (12 + 11 + 18 + 21 + 16)/5=15.6
(11 + 18 + 21 + 16 + 14)/5=16.0 . . . . .
(18 + 21 + 16 + 14 + 19)/5=17.6
12-4 The Ratio-to-Moving- Average Method
Time Series, Forecasting, and Index Numbers By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer
Slide 13
151050
20
15
10
t
Z
Original Series and Five-Period Moving Averages • Moving Average:– “Smoother”– Shorter– Deseasonalized
– Removes seasonal and irregular components
– Leaves trend and cyclical components
SITC
TSCIMA
tZ
Comparing Original Data and Smoothed Moving Average
Time Series, Forecasting, and Index Numbers By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer
Slide 14
• Ratio-to-Moving Average for Quarterly DataCompute a four-quarter moving-average
series.Center the moving averages by averaging
every consecutive pair and placing the average between quarters.
Divide the original series by the corresponding moving average. Then multiply by 100.
Derive quarterly indexes by averaging all data points corresponding to each quarter. Multiply each by 400 and divide by sum.
Ratio-to-Moving Average
Time Series, Forecasting, and Index Numbers By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer
Slide 15
151050
170
160
150
140
130
Sale
s
Time
Actual SmoothedActual Smoothed
MSD:MAD:MAPE:
Length:Moving Average
152.574 10.955 7.816
4
Four-Quarter Moving Averages Simple Centered Ratio Moving Moving to Moving
Quarter Sales Average Average Average1998W 170 * * *1998S 148 * * *
1998S 141 * 151.125 93.31998F 150 152.25 148.625 100.91999W 161 150.00 146.125 110.21999S 137 147.25 146.000 93.81999S 132 145.00 146.500 90.11999F 158 147.00 147.000 107.52000W 157 146.00 147.500 106.42000S 145 148.00 144.000 100.72000S 128 147.00 141.375 90.52000F 134 141.00 141.000 95.02002W 160 141.75 140.500 113.92002S 139 140.25 142.000 97.92002S 130 140.75 * *2002F 144 143.25 * *
Ratio-to-Moving Average: Example 12-3
Time Series, Forecasting, and Index Numbers By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer
Slide 16
Quarter Year Winter Spring Summer Fall
1998 93.3 100.91999 110.2 93.8 90.1 107.52000 106.4 100.7 90.5 95.0
2002 113.9 97.9
Sum 330.5 292.4 273.9 303.4Average 110.17 97.47 91.3 101.13
Sum of Averages = 400.07Seasonal Index = (Average)(400)/400.07
SeasonalIndex 110.15 97.45 91.28 101.11
Seasonal Indexes: Example 12-3
Time Series, Forecasting, and Index Numbers By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer
Slide 17
Seasonal Deseasonalized
Quarter Sales Index (S) Series(Z/S)*100
1998W 170 110.15 154.341998S 148 97.45 151.871998S 141 91.28 154.471998F 150 101.11 148.351999W 161 110.15 146.161999S 137 97.45 140.581999S 132 91.28 144.511999F 158 101.11 156.272000W 157 110.15 142.532000S 145 97.45 148.792000S 128 91.28 140.232000F 134 101.11 132.532002W 160 110.15 145.262002S 139 97.45 142.642002S 130 91.28 142.422002F 144 101.11 142.42
Original Deseasonalized - - -
1992F1992S1992S1992W
170
160
150
140
130
t
Sal es
Original and Seasonally Adjusted Series
Deseasonalized Series: Example 12-3
Time Series, Forecasting, and Index Numbers By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer
Slide 18
180
170
160
150
140
130
1201992F1992S1992S1992W
t
Sal e s
Trend Line and Moving Averages The cyclical component is the remainder after the moving averages have been detrended. In this example, a comparison of the moving averages and the estimated regression line: illustrates that the cyclical component in this series is negligible.
. .Z t 155 275 11059
The Cyclical Component: Example 12-3
Time Series, Forecasting, and Index Numbers By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer
Slide 19
The centered moving average, ratio to moving average, seasonal index, and deseasonalized values were determined using the Ratio-to-Moving-Average method.
Example 12-3 using the Template
This displays just a partial output for the quarterly
forecasts.
Time Series, Forecasting, and Index Numbers By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer
Slide 20Example 12-3 using the
Template
Graph of the quarterly Seasonal Index
Time Series, Forecasting, and Index Numbers By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer
Slide 21Example 12-3 using the
Template
Graph of the Data and the quarterly Forecasted values
Time Series, Forecasting, and Index Numbers By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer
Slide 22
The centered moving average, ratio to moving average, seasonal index, and deseasonalized values were determined using the Ratio-to-Moving-Average method.
Example 12-3 using the Template
This displays just a partial output for the monthly
forecasts.
Time Series, Forecasting, and Index Numbers By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer
Slide 23Example 12-3 using the
Template
Graph of the monthly Seasonal Index
Time Series, Forecasting, and Index Numbers By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer
Slide 24Example 12-3 using the
Template
Graph of the Data and the monthly Forecasted values
Time Series, Forecasting, and Index Numbers By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer
Slide 25
152.02=)(1.1015)(1)(138.03 = =ˆ
e)(negligibl 1 C1.1015 = S
138.03=)(0.837)(17-152.26=z :Trend
:17)=(t 2002 for WinterForecast
=ˆ
:series tivemultiplica a offorecast The
TSCZ
TSCZ
Forecasting a Multiplicative Series: Example 12-3
Time Series, Forecasting, and Index Numbers By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer
Slide 26
Z Trend Seasonal Cyclical IrregularTSCI
MA Trend CyclicalTC
ZMA
TSCITC
SI
ZS
TSCIS
CTI
( )( ( )( )
( )( )
S = Average of SI (Ratio - to - Moving Averages)
(Deseasonalized Data)
Multiplicative Series: Review
Time Series, Forecasting, and Index Numbers By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer
Slide 27
Smoothing is used to forecast a series by first removing sharp variation, as does the moving average.
Exponential smoothing is a forecasting method in which the forecast is based in a weighted average of current and past
series values. The largest weight is given to the present observations, less weight to the immediately preceding observation, even less weight to the
observation before that, and so on. The weights decline geometrically as we go
back in time. 0-5-10-15
0.4
0.3
0.2
0.1
0.0
Lag
Wei
ght
Weights Decline as We Go Back in Time and Sum to 1
Weights Decline as we go back in Time
-10 0
Wei
ght
Lag
12-5 Exponential Smoothing Methods
Time Series, Forecasting, and Index Numbers By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer
Slide 28
Given a weighting factor: < < :
Since
So
0 1
1 1 1 12
2 13
3
1 1 2 12
3 13
4
1 1 1 12
2 13
3
w
Zt w Zt w w Zt w w Zt w w Zt
Zt w Zt w w Zt w w Zt w w Zt
w Zt w w Zt w w Zt w w Zt
( ) ( )( ) ( ) ( ) ( ) ( )
( ) ( )( ) ( ) ( ) ( ) ( )
( ) ( )( ) ( ) ( ) ( ) ( )
Zt 1 w(Zt ) (1 w)(Zt )
Zt 1 Zt (1 w)(Zt - Zt )
The Exponential Smoothing Model
Time Series, Forecasting, and Index Numbers By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer
Slide 29
Day Z w=.4 w=.8
1 925 925.000 925.0002 940 925.000 925.0003 924 931.000 937.0004 925 928.200 926.6005 912 926.920 925.3206 908 920.952 914.6647 910 915.771 909.3338 912 913.463 909.8679 915 912.878 911.57310 924 913.727 914.31511 943 917.836 922.06312 962 927.902 938.81313 960 941.541 957.36314 958 948.925 959.47315 955 952.555 958.29516 * 953.533 955.659
Original data: Smoothed, w=0.4: ......Smoothed, w=0.8: -----
Day151050
960
950
940
930
920
910
w= .
4
Expo ne ntial S mo othing: w=0 .4 and w=0 .8
Example 12-4
Time Series, Forecasting, and Index Numbers By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer
Slide 30Example 12-4 – Using the
Template
Time Series, Forecasting, and Index Numbers By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer
Slide 31
An index number is a number that measures the relative change in a set of measurements over time. For example: the
Dow Jones Industrial Average (DJIA), the Consumer Price Index (CPI), the New York Stock Exchange (NYSE) Index.
Index number in period : = 100 Value in period Value in base period
Changing the base period of an index:
New index value: = 100 Old index valueIndex value of new base
i i
12-6 Index Numbers
Time Series, Forecasting, and Index Numbers By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer
Slide 32
Index IndexYear Price 1984-Base 1991-Base
1984 121 100.0 64.71985 121 100.0 64.71986 133 109.9 71.11987 146 120.7 78.11988 162 133.9 86.61989 164 135.5 87.71990 172 142.1 92.01991 187 154.5 100.01992 197 162.8 105.31993 224 185.1 119.81994 255 210.7 136.41995 247 204.1 132.11996 238 196.7 127.31997 222 183.5 118.7
Year
Pr i
ce
Price and Index (1982=100) of Natural Gas Price
199519901985
250
150
50
Original
Index (1984)
Index (1991)
Index Numbers: Example 12-5
Time Series, Forecasting, and Index Numbers By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer
Slide 33
Example 12-6:
AdjustedYear Salary Salary1980 29500 11953.01981 31000 11380.31982 33600 11610.21983 35000 11729.21984 36700 11796.81985 38000 11793.9
Adjusted Salary = SalaryCPI
100
CPI
Ye a r
4 5 0
3 5 0
2 5 0
1 5 0
5 01 9 9 51 9 9 01 9 8 51 9 8 01 9 7 51 9 7 01 9 6 51 9 6 01 9 5 51 9 5 0
Consumer Price index (CPI): 1967=100
Consumer Price Index – Example 12-6
Time Series, Forecasting, and Index Numbers By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer
Slide 34Example 12-6: Using the
Template
Time Series, Forecasting, and Index Numbers By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer
Slide 35
M.Phil (Statistics)
GC University, . (Degree awarded by GC University)
M.Sc (Statistics) GC University, . (Degree awarded by GC University)
Statitical Officer(BS-17)(Economics & Marketing Division)
Livestock Production Research Institute Bahadurnagar (Okara), Livestock & Dairy Development
Department, Govt. of Punjab
Name Shakeel NoumanReligion ChristianDomicile Punjab (Lahore)Contact # 0332-4462527. 0321-9898767E.Mail [email protected] [email protected]
Time Series, Forecasting, and Index Numbers By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical Officer