Chapter 2 - Timeseries Analysis

You might also like

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

FORECASTING ENGINEERING

Chapter 2:

Time Series Analysis

INSTRUCTOR:

– NGUYỄN VẠNG PHÚC NGUYÊN (nguyennvp@hcmut.edu.vn)

HCMC-Vietnam

8/24/2021 Chapter 2_Basic Forecasting _ Dr. Nguyen VP Nguyen 1


Content
• DEA (Exploratory Data Analysis)
• Data patterns
• Classification of forecasting methods
– Qualitative methods (Phương pháp định tính)
– Quantitative methods (Phương pháp đinh
lượng)
• Procedures to conduct the quantitative
methods

8/24/2021 Chapter 2_Basic Forecasting _ Dr. Nguyen VP Nguyen 2


Exploratory Data Analysis - EDA
Techniques to determine
relationships and trends, identify
outliers and influential observations,
and quickly describe or summarize
data sets.
• Stem-and-Leaf Displays
 Quick-and-dirty listing of all observations
 Conveys some of the same information as a
histogram
• Box Plots
 Median
 Lower and upper quartiles
 Maximum and minimum
EDA: Summary Measures of Population
Parameters: Sample Statistics
 Measures of Central  Measures of Variability
Tendency  Range
 Median1  Interquartile range3
 Mode2  Variance
 Standard Deviation
 Mean

 Other summary 3: khoảng giữa các tứ


1: điểm giữa/trung measures: phân vị
tuyến (geo) 4: độ lệch
2: mode là giá trị đại  Skewness 4 5: độ nhọn
diện nhất cho phân bố,  Kurtosis 5
“most”
EDA: Skewness and Kurtosis
 Skewness (Độ lệch)
– Measure of asymmetry of a frequency distribution
• Skewed to left
• Symmetric or unskewed
• Skewed to right
 Kurtosis (độ nhọn)
– Measure of flatness or peakedness of a frequency
distribution
• Platykurtic (relatively flat)
• Mesokurtic (normal)
• Leptokurtic (relatively peaked)
Skewed to left
Skewness

Symmetric

Skewed to right
Kurtosis
Platykurtic - flat distribution

Mesokurtic - not too flat and not too peaked


The sample of our height population data
Summary Report for total
Anderson-Darling Normality Test
A-Squared 0.89
P-Value 0.022
Mean 1.6222
StDev 0.0742
Variance 0.0055
Skewness 0.413421
Kurtosis -0.491419
N 64
Minimum 1.4900
1st Quartile 1.5725
Median 1.6000
3rd Quartile 1.6775
Maximum 1.7800
95% Confidence Interval for Mean
1.6037 1.6407
95% Confidence Interval for Median
1.50 1.56 1.62 1.68 1.74 1.6000 1.6300
95% Confidence Interval for StDev
0.0632 0.0898

95% Confidence Intervals

Mean

Median

1.60 1.61 1.62 1.63 1.64

What is the probability that the actual average height is greater than 1.63?
EDA: Scatter Plots • Scatter plot with
• Scatter Plots (biểu đồ phân tán) trend line.
are used to identify and report any • This type of
relationship is
underlying relationships among known
pairs of data sets. as a positive
• The plot consists of a scatter of correlation (tương
quan dương).
points, each point representing an
observation.

Correlation will be
discussed in later
chapters.
Data Pattern and Choice of Technique
• The nature of the past relationship in the
data
• The level of subjectivity in making a forecast
• The patterns of data
– “A particular way in which something usually
happens or is done”
– “A pattern is also a design or set of shapes that
show how to make something”
All of the above help us in how we classify the
forecasting technique.
Data Pattern and Choice of Technique
• Univariate forecasting techniques depend on:
– Past data patterns.
• Multivariate forecasting techniques (đa biến)
depend on
– Past relationships.
• Qualitative forecasts depend on:
– Subjectivity: Forecasters intuition.

nature of the past relationship level of subjectivity


Data Patterns
• Horizontal
– When there is no trend in the data pattern,
we deal with horizontal data pattern.
Forecast Variable

Mean

Time
Data Patterns
• Trend
– Long-term growth movement of a time series

Trend Yt Trend
Yt

t t

Yt Trend Yt
Trend

t t
Data Patterns
• Seasonal Pattern
– A predictable and repetitive movement
observed around a trend line within a period
of 1 year or less.
Forecast Variable

Time
Data Patterns

• Cyclical (chu kỳ)


– Occurs with business and economic
expansions and contractions.
– Lasts longer than 1 year.
– Correlated with business cycles.
8/24/2021 Chapter 3_Time Series Analysis _ Dr. Nguyen VP Nguyen 16
Other Data Patterns
• Autocorrelated Pattern (tự tương quan)
– Data in one period are related to their values
in the previous period.
– Generally, if there is a high positive
autocorrelation, the value in the month of
June, for example, is positively related to the
values in the month of May.
– This pattern is more fully discussed when we
talk about the Box–Jenkins methodology.
Classification of forecasting methods

8/24/2021 Chapter 2_Basic Forecasting _ Dr. Nguyen VP Nguyen 18


1-18
Fig. 1. The product life curve with its suitable forecasting methods
(Levenhach & Cleary, 2006)

Levenhach, H., & Cleary, J. P. (2006).


Forecasting: practice and process for demand management, Belmont: Thomson, Duxbury.

8/24/2021 Chapter 2_Basic Forecasting _ Dr. Nguyen VP Nguyen 19


1-19
8/24/2021 Chapter 2_Basic Forecasting _ Dr. Nguyen VP Nguyen 20
1-20
Time Series
• Time series analysis predicts the future from past data.
– A time series is a set of time-ordered observation on a variable
during successive and equal time periods.
– By studying how a variable (historical demand) changes over time, a
relationship between demand and time can be formulated and used
to predict future demand levels.
• In time series analysis, historical data are analyzed (to
examine the nature or structure of sth, especially by separating it into its parts, in order to
) and decomposed (
understand or explain it ) to divide sth into smaller parts
to identify the relevant components which influence the
variable being forecasted.
– The time series data may contain up to five interacting components-
level, trends, seasonal variations, cycling
variations, and random variations.
8/24/2021 Chapter 2_Basic Forecasting _ Dr. Nguyen VP Nguyen 21
Time Series’ Components

• The level component is present in all data and


represents the central tendency of a time series at
any given time.
• The trend component identifies the rate of growth
or decline of a series over time.
• Seasonal variation usually consists of annually
recurring movements above and below the trend
line (or level) and are present when demand
fluctuates in a repetitive pattern from year to year.
Examples of products with a seasonal pattern are
antifreeze, soft drinks, ice cream, toys, snow tires,
grass seed, textbooks, air conditioners, and
greeting cards.
8/24/2021 Chapter 2_Basic Forecasting _ Dr. Nguyen VP Nguyen 22
Time Series’ Components
• Cycling variations are long tern oscillation or swings about
a trend line and account for some of the variation between
the trend line and raw data points. The cycles may or may
not periodic, but they often are the result of business cycles
of expansion and contraction of economic activity over a
number of years, i.e., prosperity, recession, depression, and
recovery, may vary as to the time of occurrence, the length
of the phases, and the amplitude of the fluctuations.
• Random variations have no discernable patterns and often
are without specific, assignable causes. They are often
referred to as noise, residuals, or irregular variations, and
they have such causes as measurement errors, floods, fires,
earthquakes, wars, strikes, and other unusual conditions.
Example: see more at next few slides
8/24/2021 Chapter 2_Basic Forecasting _ Dr. Nguyen VP Nguyen 23
• A seasonal component is a pattern in the time series that repeats itself
with the same period of recurrence.
– An example of a seasonal component that is not associated with the
seasons is the sales of tickets to a movie theater. Ticket \sales may well
be higher on Friday and Saturday evenings, than they are on Tuesday and
Wednesday afternoons. If this pattern repeats itself over time, the series is
said to exhibit a daily seasonal effect.
– Likewise, phone calls coming to a switchboard may be higher at certain
hours of the day (between 9:00 a.m. and 10:00 a.m.) than at other times
(between 3:00 p.m. and 4:00 p.m.). If this pattern repeats itself in a
predictable way then we have an hourly seasonal component.

8/24/2021 Chapter 2_Basic Forecasting _ Dr. Nguyen VP Nguyen 24


Time Series: Index Numbers

• Index numbers allow relative comparisons over time


• Index numbers are reported relative to a Base Period
Index

• Base period index = 100 by definition


• Used for an individual item or measurement
• Why do we study index? Seasonal correction in some
forecasting techniques

8/24/2021 Chapter 2_Basic Forecasting _ Dr. Nguyen VP Nguyen 25


Time Series: Index Numbers

• Simple Index number formula:

yt
It  100
y0
where
It = index number at time period t
yt = value of the time series at time t
y0 = value of the time series in the base period

8/24/2021 Chapter 2_Basic Forecasting _ Dr. Nguyen VP Nguyen 26


Example 2.3.1: Data of Company orders from 1995 to 2003:
Index
Year Number of (base year
Orders = 2000)
1995 272 85.0 y1996 288
I1996  100  (100 )  90
1996 288 90.0 y 2000 320
1997 295 92.2
1998 311 97.2
Base Year:
y 2000 320
1999 322 100.6 I2000  100  (100 )  100
2000 320 100.0
y 2000 320
2001 348 108.8
y 2003 384
2002 366 114.4 I2003  100  (100 )  120
y 2000 320
2003 384 120.0
8/24/2021 Chapter 2_Basic Forecasting _ Dr. Nguyen VP Nguyen 27
y 288 • Orders in 1996 were 90% of
I1996  1996 100  (100 )  90 base year orders
y 2000 320

• Orders in 2000 were 100% of


y 2000 320
I2000  100  (100 )  100 base year orders (by
y 2000 320 definition, since 2000 is the
base year)
y 2003 384
I2003  100  (100 )  120
y 2000 320 • Orders in 2003 were 120% of
base year orders
8/24/2021 Chapter 2_Basic Forecasting _ Dr. Nguyen VP Nguyen 28
(Extra) Aggregate Price Indexes

• An aggregate index is used to measure the rate


of change from a base period for a group of items
Aggregate
Price Indexes

Unweighted Weighted
aggregate aggregate
price index price indexes

Paasche Index Laspeyres Index


8/24/2021 Chapter 2_Basic Forecasting _ Dr. Nguyen VP Nguyen 29
(Extra) Unweighted Aggregate Price Index

• Unweighted aggregate price index formula:

It 
 p t
(100 )
p 0
where
It = unweighted aggregate price index at time t
pt = sum of the prices for the group of items at time t
p0 = sum of the prices for the group of items in the base period
8/24/2021 Chapter 2_Basic Forecasting _ Dr. Nguyen VP Nguyen 30
(Extra) Unweighted Aggregate Price Index Example
Automobile Expenses:
Monthly Amounts ($):
Lease Index
Year payment Fuel Repair Total (2001=100) Change
2001 260 45 40 345 100.0 0%
2002 280 60 40 380 110.1 10.1%
2003 305 55 45 405 117.4 17.4%
2004 310 50 50 410 118.8 18.8%

I2004 
 p 2004
(100) 
410
(100)  118.8
p 2001 345
• Combined expenses in 2004 were
18.8% higher in 2004 than in 2001
8/24/2021 Chapter 2_Basic Forecasting _ Dr. Nguyen VP Nguyen 31
(Extra) Weighted Aggregate Price Indexes

• Paasche index • Laspeyres index

It 
 qp t t
(100 ) It 
 qp 0 t
(100 )
q p t 0 q p 0 0

qt = weighting percentage at q0 = weighting percentage at


time t base period

pt = price in time period t


p0 = price in the base period
8/24/2021 Chapter 2_Basic Forecasting _ Dr. Nguyen VP Nguyen 32
(Extra) Commonly Used Index Numbers

• Consumer Price Index (CPI): weighted aggregate index similar


to Laspeyres Index, is based on items grouped into categories
(such as food, housing, clothing, transportation, medical care,
entertainment, and miscellaneous item)
• Producer Price Index (PPI): like the CPI, the PPI is a
Laspeyres weighted aggregate Index.
• Stock Market Indexes
– Dow Jones Industrial Average
– S&P 500 Index
– NASDAQ Index
– VN Index

8/24/2021 Chapter 2_Basic Forecasting _ Dr. Nguyen VP Nguyen 33


(An application of Index Numbers) Deflating a Time Series

• Observed values can be adjusted to base year equivalent


• Allows uniform comparison over time
• Deflation formula:

yt
y adjt  (100 )
It
where

y adjt = adjusted time series value at time t


yt = value of the time series at time t
It = index (such as CPI) at time t
8/24/2021 Chapter 2_Basic Forecasting _ Dr. Nguyen VP Nguyen 34
(An application of Index Numbers) Deflating a Time Series

• Which movie made more money (in real terms)?


Production Movie Total Gross $
Year Title
Gone With the
1939 199
Wind
1977 Star Wars 461
1997 Titanic 601
(Total Gross $ = Total domestic gross ticket receipts in $millions)
Assignment in group: The Lord of the Rings (2001, 2002, 2003; CPI={23, 24,
36}), The series of Harry Potter (2001, 2005 and 2007; CPI={43, 18, 21}),
Spider man (2002, 2004, 2007; CPI={35, 9.5, 28}) All-Time Box Office)

8/24/2021 Chapter 2_Basic Forecasting _ Dr. Nguyen VP Nguyen 35


(An application of Index Numbers) Deflating a Time Series

Movie Total CPI Gross adjusted


Year Title Gross (base year = to 1984 dollars
1984)
Gone With the
1939 199 13.9 1431.7
Wind
1977 Star Wars 461 60.6 760.7
1997 Titanic 601 160.5 374.5

• GWTW made about twice as


199 much as Star Wars, and
GWTW adj1984  (100 )  1431.7
13.9 about 4 times as much as
Titanic when measured in
equivalent dollars
8/24/2021 Chapter 2_Basic Forecasting _ Dr. Nguyen VP Nguyen 36

You might also like