Time Series Analysis and Forecasting

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 26

Time Series Analysis

and Forecasting
Introduction to Time Series Analysis
• A time series is a set of observations on a quantitative variable collected over
time. Time series data is used to analyze and understand underlying patterns
and behaviors over time, and it can be applied to various fields such as finance,
economics, environmental science, and engineering
• Examples
• Dow Jones Industrial Averages
• Historical data on sales, inventory, customer counts, interest rates, costs,
etc
• Businesses are often very interested in forecasting time series variables.
• In time series analysis, we analyze the past behavior of a variable to predict its
future behavior.
Simple Example
Characteristics of Time Series
1.Trend: The long-term movement or direction in the data over a
period. It can be upward, downward, or neutral.
2.Seasonality: Regular, repeating patterns or cycles in data at fixed
intervals, such as daily, monthly, or annually.
3.Cyclic Patterns: Longer-term oscillations that are not of fixed periods
but still show repeated fluctuations over time.
4.Irregular/Noise: Random variations or fluctuations that do not follow
a pattern and are unpredictable.
Components of Time Series
Analysis
1.Understanding Patterns: Identifying and understanding the various
components of a time series, such as trends, seasonality, and cycles.
2.Modeling: Creating statistical models to represent the time series
data.
3.Forecasting: Using models to predict future values based on historical
data.
4.Decomposition: Breaking down a time series into its constituent
components (trend, seasonality, and residuals) to better understand
and analyze the data.
Applications of Time Series
Analysis
• Forecasting: Predicting future values based on past data, is crucial for
budgeting, financial planning, and resource allocation.
• Anomaly Detection: Identifying outliers or unusual patterns that may
indicate fraud, equipment failure, or other significant events.
• Seasonal Adjustment: Make more accurate comparisons across
different periods.
Cont…
• Understanding the dynamic or time-dependent structure of the
observations of a single series (univariate analysis)
• Forecasting of future observations
• Ascertaining the leading, lagging and feedback relationships among
several series (multivariate analysis)

7
Time Series Components
Descriptive v. Inferential Analysis
• Descriptive Analysis
• Picture of the behavior of the time series
• e.g. Index numbers, exponential smoothing
• No measure of reliability
• Inferential Analysis
• Goal: Forecasting future values
• Measure of reliability

© 2011 Pearson Education, Inc


Picture of the behavior of the
time series

10
Cont…
• Time Frame (How far can we predict?)
• short-term (1 - 2 periods)
• medium-term (5 - 10 periods)
• long-term (12+ periods)
• Trend
• Gradual, long-term movement (up or down) of demand.
• Easiest to detect
Exponential Smoothing
• Exponential smoothing is a way to predict future data points by giving
more importance to recent observations while still considering past
data. It's like looking at recent sales numbers more closely than older
ones to guess what might happen next.
• Removes rapid fluctuations in time series (less sensitive to short–term
changes in prices)
• Allows overall trend to be identified
• Used for forecasting future values
• Exponential smoothing constant (w) affects the “smoothness” of
series
Steps for Calculating an
Exponentially Smoothed Series
Calculate the exponentially smoothed series Et from the
original time series Yt as follows


Exponential Smoothing Example
The closing stock prices on the last day
of the month for Daimler–Chrysler in
2005 and 2006 are given in the table.
Create an exponentially smoothed
series using w = .2.
Exponential Smoothing Solution
E1 = 45.51
E2 = .2(46.10) + .8(45.51) = 45.63
E3 = .2(44.72) + .8(45.63) = 45.45

E24 = .2(61.41) + .8(53.92) = 55.42

© 2011 Pearson Education, Inc


0
10
20
30
40
50
60
70

Jan-05
Feb-05
Mar-05
Apr-05
May-05
Jun-05
Jul-05
Aug-05
Sep-05
Oct-05
Actual Series

Nov-05
Dec-05
(w = .2)

Jan-06
Feb-06
Mar-06
Apr-06
Smoothed Series

May-06
Jun-06
Jul-06
Aug-06
Sep-06
Oct-06
Exponential Smoothing Solution

Nov-06
Dec-06
Inferential Analysis
• Moving Averages
• Regression Analysis
Moving Averages

A moving average is a method


used to smooth out fluctuations
in time series data, providing a
clearer view of the trend. It
involves calculating the average
of a fixed number of past
observations. Here's an example
of how to calculate and visualize
a moving average in Excel.
Example
Weighted Moving Average
• The moving average technique assigns equal weight to all previous observations. A Weighted Moving
Average (WMA) assigns different weights to each data point in the moving average calculation,
giving more importance to certain data points. The weights usually decrease in a linear manner .
Example - WMA
Suppose we have the following sales data and we want to calculate a 3-
period weighted moving average. We will assign weights of 3, 2, and 1
to the most recent, the second most recent, and the third most recent
data points, respectively.
Example
Calculate the Weighted Moving Average for April:
WMA=(3×1700)+(2×1600)+(1×1500)/3+2+1
WMA=5100+3200+1500/6
​WMA=9800/6
WMA=1633.33
Calculate for May:
WMA=(3×1650)+(2×1700)+(1×1600)/6
WMA=4950+3400+1600/6
WMA=9950/6
WMA=1658.33
Simple Linear Regression
• Model: E(Yt) = β0 + β1t
• Relates time series, Yt, to time, t
• Cautions
• Risky to extrapolate (forecast beyond observed data)
• Does not account for cyclical effects
Simple Linear Regression Example
The data shows the average
undergraduate tuition at all 4–
year institutions for the years
1996–2004 (Source: U.S. Dept.
of Education). Use least–
squares regression to fit a
linear model. Forecast the
tuition for 2005 (t = 10) and
compute a 95% prediction
interval for the forecast.
Simple Linear Regression Solution
From Excel

Yˆt 7997.533  528.158t


Simple Linear Regression Solution

$15,000

$14,000
Yˆt 7997.533  528.158t
$13,000

$12,000
Tuition

$11,000

$10,000

$9,000

$8,000
1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005
Year

https://trumpexcel.com/moving-average-excel/

You might also like