Time Series 1

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 23

Time Series

Forecasting
WEEK-1
Why Forecast?
• Every organization faces internal and external risks, such as high competition, failure of
technology, labor unrest, inflation, recession, and change in government laws.

• Forecast is necessary to lessen the adverse effects of risks

Benefits of Forecasting
• It helps in setting business targets/goals
• Understand the past behavior
• Plan for the future
• Evaluate the current accomplishment
What is Time Series?
• A time series is a sequence of measurements on the same variable collected
over time

• Time series is another technique for forecasting (You use


past data/observations to predict the future)

• Example :
• Daily stock price of a company
• Weekly cash withdrawal from your nearest ATM
• Monthly sales volume
• Annual GDP for a country
Why do you another technique for
forecasting?
• Because not all data are the same, or similar. Because different types of data possess
different features, different methods of forecast becomes applicable

Independent variable
Dependent
variable Month Sales
Price Promotion Adv Sales Jan 250
121 10 300 1000 Feb 300
115 12 250 2300 Mar 372
117 5 275 1900 April 179
125 10 600 1400 May 185
127 15 479 1300 June 194
135 25 450 1350
July ?
127 19 410 ?

Prediction Prediction
Sales = 23 -0.42 Price+ 0.16Promotion+0.03 Adv One Dependent variable – Sales
What are the features of Time-Series
• Data are not independent
• Data should be equally spaced, that is, data should be available at regular
intervals
• Ordering is very important because there is dependency and changing the
order will change the meaning of the data
Month Sales Period Sales Month Sales
Jan 250 Jan 250 Jan 250
Feb 300 Feb 300 May 185
Mar 372 Feb 300
2016 372
April 179
2017 179 April 179
May 185
Q3 185 Mar 372
June 194
Q1 194 June 194
July ?
What is NOT a Time Series

• Data collected on multiple items at the same point of time is not


a time series!
Example: NSE average on a single day

• When time periods are not the same: For example in a single
time series both yearly and quarterly data cannot be mixed
Steps in Forecasting
• Problem definition
Before a forecasting problem is taken up, decision needs to be made regarding the forecast horizon -
Period/Tenure/Range to forecast
a) Long term (5-10 yrs.)
b) Mid-term (1-5 yrs.)
c) Short-term (2 weeks –for few months)

• Gathering information
a) Understanding historical pattern of data
b) Using past knowledge forecasting for future
If volume of data is limited, forecasts will not be reliable enough
If data is available for very long past, data may not be useful at all
Steps in forecasting contd…
Do we need 35 years for data to predict for next one year?

Series not stable


V
o
L

Series stable

Years
Steps in forecasting contd1…

• Exploratory Data Analysis(EDA)


Plotting the time series, decomposition, treating missing values, understanding the pattern,
unusual observations etc

• Selecting and using the model


One needs to prepare the data and use algorithms Like Holt winters, ARIMA etc to make
prediction

• Evaluating the model


Checking the accuracy of the prediction and reducing the errors
Components of Time Series

• Based on the pattern of the data, time series has been split into 3
components
1) Trend
2) Seasonality
3) Irregular component
Trend

• Long term movement of a series: either increasing or decreasing

Upward Trend
Downward Trend
Seasonality

• Representing intra-year stable fluctuations repeatable year after


year with respect to timing, direction and magnitude
Characteristics of Time Series

• Trend : Positive or Negative


• Seasonality: patterns within a year
• Outliers : Does it have extreme values
• Long run cycle: Did you notice something happened over a
period of time
• Abrupt change : Have you noticed a sudden change
Example 1:

Trend : Initial years Outliers : No Long run cycle: from 1974 to 1980

Seasonality: No Abrupt change : Yes


Example 2

Trend : Upward Outliers : No Long run cycle: No

Seasonality: Yes Abrupt change : No


Example 3

Trend : Yes -increasing Outliers : No Long run cycle: Yes

Seasonality: Yes Abrupt change : No


Example 4

Trend : Yes at beginning Outliers : Yes Long run cycle: Yes

Seasonality: Yes Abrupt change : No


Decomposition
• Visualization of plots helps in understanding pattern but does not help in
quantification
• Decomposition helps in comparing the long-term movement of the series
(Trend) vis-a-vis short-term movement (seasonality) to understand which has
the higher influence
• Y t : time series value (actual data) at period t.
• S t : seasonal component (index) at period t.
• T t : trend cycle component at period t.
• I t : irregular (remainder) component at period t
Decomposition
• 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. Here seasonal variation is NOT
constant
Example 1
Multiplicative decomposition Additive decomposition

Multiplicative - Random & Constant Additive –It shows a pattern


Example 2
Multiplicative decomposition Additive decomposition
Residuals or Errors or White Noise
• Irregular fluctuations due to random or unforeseen circumstances /events for a short
duration e.g. pandemic, flood, earthquake etc. It is also known as White noise or error

• It is a random component and does not help in prediction

• It’s a part of the series that can’t be explained through systematic components , that is,
trend or seasonality

• It is assumed to have a normal distribution


Missing values

• Backward Fill (Next Observation Carried Backward)

• Forward Fill (Last Observation Carried Forward)

• Interpolation – Linear
• Interpolation – Spline

You might also like