1. TIME SERIES FORECASTING
12-Jan-18 1
haritika74@gmail.com
BABIINTLMAY19001
This file is meant for personal use by haritika74@gmail.com only.
Sharing or publishing the contents in part or full is liable for legal action.
2. DECOMPOSITION OF TIME
SERIES
12-Jan-18 2
haritika74@gmail.com
BABIINTLMAY19001
This file is meant for personal use by haritika74@gmail.com only.
Sharing or publishing the contents in part or full is liable for legal action.
4. Visualization of Seasonality
Helps to see the nature of seasonality
But does not help in quantification
4
12-Jan-18
Objective of this lesson is to extract time series
components numerically to evaluate their
importance in the historical pattern of the data
haritika74@gmail.com
BABIINTLMAY19001
This file is meant for personal use by haritika74@gmail.com only.
Sharing or publishing the contents in part or full is liable for legal action.
5. Why Decompose
• To understand revenue generation without the quarterly
effects
̶ De-seasonalize the series
̶ Estimate and adjust by seasonality
• Compare the long-term movement of the series (Trend) vis-a-
vis short-term movement (seasonality) to understand which
has the higher influence
• If revenue for multiple sector are to be compared and if the
sectors show non-uniform seasonality, de-seasonalized series
needs to be compared
5
12-Jan-18
haritika74@gmail.com
BABIINTLMAY19001
This file is meant for personal use by haritika74@gmail.com only.
Sharing or publishing the contents in part or full is liable for legal action.
6. What is Seasonality?
Seasonality is the relative increase or decrease of sales
(demand or consumption) every period(quarter or
month or week) compared to the yearly average
6
Heuristic example with 4 quarters
Yearly sale = 400 units
Quarterly average = 100 units
Actual sales
Q1 = 80 units Q2 = 70 units Q3 = 200 units
Q4 = 50 units
Seasonality estimate
Q1 = -20 Q2= -30 Q3 = +100 Q4 = - 50
haritika74@gmail.com
BABIINTLMAY19001
This file is meant for personal use by haritika74@gmail.com only.
Sharing or publishing the contents in part or full is liable for legal action.
7. Decomposition Model
7
Yt : time series value (actual data) at period t.
St : seasonal component (index) at period t.
Tt : trend cycle component at period t.
It : irregular (remainder) component at period t
Additive model: Observation = Trend + Seasonality + Error
Yt = Tt + St + It
Useful when the seasonal variation is relatively constant over time
Multiplicative model: Observation = Trend * Seasonality * Error
Yt = Tt * St * It
Multiplicative models are more realistic
haritika74@gmail.com
BABIINTLMAY19001
This file is meant for personal use by haritika74@gmail.com only.
Sharing or publishing the contents in part or full is liable for legal action.
8. Caselet I: Quarterly Revenue
• Quarterly revenue is a sum of Trend, Seasonality and
Irregular component
• Would like to understand relative effects of the 4 quarters
• Would like to understand the long-term movement of the
series, after seasonal effect has been eliminated
• Example of an Additive Seasonality Model
Yt = Tt + St + It
Revenue = Trend + Seasonality + Error
8
haritika74@gmail.com
BABIINTLMAY19001
This file is meant for personal use by haritika74@gmail.com only.
Sharing or publishing the contents in part or full is liable for legal action.
9. Decomposition in R
IncDec<-stl(Income, s.window='p') constant seasonality
plot(IncDec)
IncDec
IncDec7<-stl(Income, s.window=7) seasonality changes
plot(IncDec7)
IncDec
DeseasonRevenue <- (IncDec7$time.series[,2]+IncDec7$time.series[,3])
ts.plot(DeseasonRevenue, Revenue, col=c("red", "blue"), main="Comparison
of Revenue and Deseasonalized Revenue")
9
haritika74@gmail.com
BABIINTLMAY19001
This file is meant for personal use by haritika74@gmail.com only.
Sharing or publishing the contents in part or full is liable for legal action.
10. Caselet I: Quarterly Revenue
10
haritika74@gmail.com
BABIINTLMAY19001
This file is meant for personal use by haritika74@gmail.com only.
Sharing or publishing the contents in part or full is liable for legal action.
11. 12-Jan-18 11
Caselet I: Quarterly Revenue
haritika74@gmail.com
BABIINTLMAY19001
This file is meant for personal use by haritika74@gmail.com only.
Sharing or publishing the contents in part or full is liable for legal action.
13. Caselet II: Champagne Sales
• Monthly sales is a sum of Trend, Seasonality and Irregular
component
• Would like to understand relative effects of the 12 months
• Would like to understand whether there is at all any
movement of the sales series after the seasonal fluctuations
are eliminated
• Example of an Additive Seasonality Model
Yt = Tt + St + It
Sales = Trend + Seasonality + Error
13
haritika74@gmail.com
BABIINTLMAY19001
This file is meant for personal use by haritika74@gmail.com only.
Sharing or publishing the contents in part or full is liable for legal action.
14. Caselet II: Champagne Sales
12-Jan-18 14
haritika74@gmail.com
BABIINTLMAY19001
This file is meant for personal use by haritika74@gmail.com only.
Sharing or publishing the contents in part or full is liable for legal action.
15. Caselet II: Champagne Sales
12-Jan-18 15
haritika74@gmail.com
BABIINTLMAY19001
This file is meant for personal use by haritika74@gmail.com only.
Sharing or publishing the contents in part or full is liable for legal action.
16. Caselet II: Champagne Sales
12-Jan-18 16
haritika74@gmail.com
BABIINTLMAY19001
This file is meant for personal use by haritika74@gmail.com only.
Sharing or publishing the contents in part or full is liable for legal action.
17. Caselet II: Champagne Sales
• Practically there is no effect of any YOY movement
• The changes we see are almost all due to monthly
fluctuations
17
haritika74@gmail.com
BABIINTLMAY19001
This file is meant for personal use by haritika74@gmail.com only.
Sharing or publishing the contents in part or full is liable for legal action.
18. Caselet II: Champagne Sales
Critical look at seasonality
• During first part of the
year almost no change
• Sharp drop in sales in
August
• Last 4 months show
steep increase in sales
18
haritika74@gmail.com
BABIINTLMAY19001
This file is meant for personal use by haritika74@gmail.com only.
Sharing or publishing the contents in part or full is liable for legal action.
19. Caselet III: Passenger Volume
12-Jan-18 19
haritika74@gmail.com
BABIINTLMAY19001
This file is meant for personal use by haritika74@gmail.com only.
Sharing or publishing the contents in part or full is liable for legal action.
20. Caselet III: Passenger Volume
• There is a definite upward movement YOY
• Seasonal fluctuations increasing as total volume increases
• Example of an Multiplicative Seasonality Model
Yt = Tt * St * It
Volume= Trend *Seasonality * Error
20
• Need logarithmic transformation to convert into an additive
series
Log(Vol) = log(Trend) + log(Seasonality) + log(Error)
haritika74@gmail.com
BABIINTLMAY19001
This file is meant for personal use by haritika74@gmail.com only.
Sharing or publishing the contents in part or full is liable for legal action.
21. Caselet III: Passenger Volume
12-Jan-18 21
haritika74@gmail.com
BABIINTLMAY19001
This file is meant for personal use by haritika74@gmail.com only.
Sharing or publishing the contents in part or full is liable for legal action.
22. Caselet III: Passenger Volume
12-Jan-18 22
haritika74@gmail.com
BABIINTLMAY19001
This file is meant for personal use by haritika74@gmail.com only.
Sharing or publishing the contents in part or full is liable for legal action.
23. Caselet III: Passenger Volume
Write conclusions on your own:
• Which part contributes more – Trend or Seasonality?
• Which month(s) show high passenger volume compared to
yearly average?
• Which month(s) show low passenger volume compared to
yearly average?
23
haritika74@gmail.com
BABIINTLMAY19001
This file is meant for personal use by haritika74@gmail.com only.
Sharing or publishing the contents in part or full is liable for legal action.
24. Caselet III: Passenger Volume
Critical look at seasonality
• From Feb passenger
volume starts
increasing
• Jun – Sep shows high
volume
• Jul – Aug has highest
vol
• Dec shows slight
increase
24
haritika74@gmail.com
BABIINTLMAY19001
This file is meant for personal use by haritika74@gmail.com only.
Sharing or publishing the contents in part or full is liable for legal action.
25. Next Step
Ultimate goal of understanding the time series
components is to forecast for the coming years
In the next lesson we apply forecast by
decomposition, as well as learn about other
forecast methods
25
12-Jan-18
Thank you
haritika74@gmail.com
BABIINTLMAY19001
This file is meant for personal use by haritika74@gmail.com only.
Sharing or publishing the contents in part or full is liable for legal action.