ST 3009 Lecture 3

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 24

APPLIED TIME SERIES ST 3009

Dr. N.D. Basnayake


MOVING AVERAGE Year
Sales
(GWh)
5-MA

1989 2354.34
1990 2379.71
1991 2318.52 2381.53
1992 2468.99 2424.56
1993 2386.09 2463.76
1994 2569.47 2552.60
1995 2575.72 2627.70
1996 2762.72 2750.62
1997 2844.50 2858.35
1998 3000.70 3014.70
1999 3108.10 3077.30
2000 3357.50 3144.52
LAGGED TIME SERIES

x t-1 (lag 1
t xt
value)
1 13 *
2 14 13
3 8 14
4 10 8
5 16 10
FIRST DIFFERENCE OPERATOR
FORECASTING VIA TIME SERIES DECOMPOSITION
This is the basic method in time series forecasting.

1. At first, you need to identify the underlying patterns of the time series of
interest.

2. Then you determine the format of the decomposition that can be


applied to that particular time series. (Additive or multiplicative)

3. Depending on the decomposition identified, you perform various


operations on the time series to forecast the next time step or next time
steps.
STEP 1: ESTIMATE THE TREND
Estimate the trend

Estimate the trend with a Model the trend with a


smoothing procedure such as regression equation.
moving averages.
[With this approach no equation is
used to describe trend.]
STEP 2: DETREND THE TIME SERIES
ADDITIVE DECOMPOSITION MULTIPLICATIVE DECOMPOSITION
subtracting the trend estimates from dividing the series by the trend
the series values

𝑌෠𝑡 = 𝑇෠𝑡 + 𝑆መ𝑡 𝑌෠𝑡 = 𝑇෠𝑡 ∗ 𝑆መ𝑡


log 𝑌෠𝑡 = log 𝑇෠𝑡 + log 𝑆መ𝑡
STEP 3: ESTIMATE THE SEASONAL FACTORS
USING DETRENDED SERIES

• For monthly data, this entails estimating an effect for each month of the
year.

• For quarterly data, this entails estimating an effect for each quarter.

The simplest method for estimating these effects is to average the de-trended
values for a specific season. For instance, to get a seasonal effect for January,
we average the de-trended values for all Januarys in the series, and so on.
The seasonal effects are usually adjusted so that they average to 0 for an
additive decomposition or they average to k (no. of seasons) for a
multiplicative decomposition.
STEP 4: FORECAST THE NEXT VALUE/S
Forecast values using the trend estimates and seasonal estimates.

ADDITIVE DECOMPOSITION MULTIPLICATIVE DECOMPOSITION

𝑌෠𝑡 = 𝑇෠𝑡 ∗ 𝑆መ𝑡


𝑌෠𝑡 = 𝑇෠𝑡 + 𝑆መ𝑡 log 𝑌෠𝑡 = log 𝑇෠𝑡 + log 𝑆መ𝑡
STEP 1 (IN DETAIL): ESTIMATING THE TREND
METHOD 1: ESTIMATING THE TREND USING MOVING AVERAGE SMOOTHING
STEP 1 (IN DETAIL): ESTIMATING THE TREND
Sales
Year 5-MA
(GWh)
1989 2354.34
MOVING AVERAGE SMOOTHING
1990 2379.71
1991 2318.52 2381.53
1992 2468.99 2424.56
1993 2386.09 2463.76
1994 2569.47 2552.60
1995 2575.72 2627.70
1996 2762.72 2750.62
1997 2844.50 2858.35
1998 3000.70 3014.70
1999 3108.10 3077.30
2000 3357.50 3144.52
STEP 1 (IN DETAIL): ESTIMATING THE TREND
MOVING AVERAGE SMOOTHING
STEP 1 (IN DETAIL): ESTIMATING THE TREND
MOVING AVERAGE SMOOTHING

Effect of changing the order


of the moving average
STEP 1 (IN DETAIL): ESTIMATING THE TREND
MOVING AVERAGE OF MOVING AVERAGES (CENTERED MOVING AVERAGE)
Year Quarter Observation 4-MA 2x4-MA
WHEN m IS EVEN 1992 Q1 443
(TO MAKE IT 1992 Q2 410 451.25
SYMMETRIC) 1992 Q3 420 448.75 450.00
1992 Q4 532 451.50 450.12
When a 2-MA follows
a moving average of 1993 Q1 433 449.00 450.25
an even order (such as 1993 Q2 421 444.00 446.50
4), it is called a
“centered moving 1993 Q3 410 448.00 446.00
average of order 4”. 1993 Q4 512 438.00 443.00
STEP 1 (IN DETAIL): ESTIMATING THE TREND
METHOD 2: ESTIMATE THE TREND USING REGRESSION
Linear Trend: Tt = β0 + β1 t
dependent independent
variable. variable.
STEP 1: ESTIMATING THE TREND
Year Quarter Sales in millions Time point
1992 Q1 24 t=1
Linear Trend: Tt = β0 + β1 t Q2 32 t=2
Q3 36 t=3
Q4 27 t=4
1993 Q1 26 t=5
Q2 34 t=6
Q3 38 t=7
Q4 29 t=8
1994 Q1 28 t=9
Q2 32 t=10
Q3 37 t=11
Q4 31 t=12
STEP 1: ESTIMATING THE TREND

Linear Trend: Tt = β0 + β1 t
The estimated trend line, 𝑇෠𝑡 = 0.3961𝑡 + 28.621
STEP 2 & 3: DETRENDING AND ESTIMATING THE
SEASONAL EFFECT
STEP 2 & 3: DETRENDING AND ESTIMATING THE
SEASONAL EFFECT (ADDITIVE DECOMPOSITION)
STEP 2 & 3: DETRENDING AND ESTIMATING THE
SEASONAL EFFECT
1. Subtract the trend either from MA method or regression) from corresponding
values of the time series (seasonal effect).
2. Calculate the average seasonal effect for each season (i.e for quarterly data,
there should be 4 average values)
3. Obtain the summation of the average seasonal effect values (Need to take this to
0)
4. Divide the answer in step 3 from the number of seasons(for quarterly data, divide
by 4)
5. Subtract the answer from step 5 from each seasonal effect to produce the
ADJUSTED SEASONAL EFFECTS (𝑺 ෡𝒕 ) corresponding to each season.
STEP 4: FORECASTING BASED ON ADDITIVE
DECOMPOSITION
Obtain the de-seasonalized series by substracting adjusted seasonal effect
from the original series.
STEP 4: FORECASTING BASED ON ADDITIVE
DECOMPOSITION
Fit a regression model taking the x-axis (independent) as time (t) and the y-
axis (dependent) as the de-seasonalised series.
STEP 4: FORECASTING BASED ON ADDITIVE
DECOMPOSITION
𝑌෠𝑡 = 𝑇෠𝑡 + 𝑆መ𝑡
𝑇෠𝑡 = 27.6439 + 0.58153𝑡
Since we are forecasting the 1st two quarters of 1971, the respective time indices are
21 and 22.
𝑇෠21 = 27.6439 + 0.58153*21 = 39.85603
𝑇෠22 = 27.6439 + 0.58153*22 = 40.43756

Year Quarter Time Index ෡t + S෠ t


෡t = T
Y
෡t
T adj. S෠ t
1 21 39.85603 -4.156 35.70003
1971
2 22 40.43756 1.281 41.71856
THANK YOU!

See you at the next lecture!


24

You might also like