Time Series Analysis - An Introduction
Time Series Analysis - An Introduction
-- An Introduction --
AMS 586
1
Objectives of time series analysis
Data description
Data interpretation
Modeling
Control
Prediction & Forecasting
2
Time-Series Data
• Numerical data obtained at regular time
intervals
• The time intervals can be annually, quarterly,
monthly, weekly, daily, hourly, etc.
• Example:
Year: 2005 2006 2007 2008 2009
Sales: 75.3 74.2 78.5 79.7 80.2
3
Time Plot
A time-series plot (time plot) is a two-
dimensional plot of time series data
12.00
10.00
4
Time-Series Components
Time Series
5
Trend Component
Sales
6 Time
Trend Component
(continued)
Time Time
Downward linear trend Upward nonlinear trend
7
Seasonal Component
• Short-term regular wave-like patterns
• Observed within 1 year
• Often monthly or quarterly
Sales
Summer
Winter
Summer
Winter Spring Fall
Spring Fall
Time (Quarterly)
8
Cyclical Component
• Long-term wave-like patterns
• Regularly occur but may vary in length
• Often measured peak to peak or trough to
trough 1 Cycle
Sales
Year
9
Irregular/Random Component
11
Non-seasonal Models
with Trend
Xt = mt + Yt
12
Classical Decomposition Model
with Trend and Season
Xt = mt + st + Yt
13
Non-seasonal Models
with Trend
There are two basic methods for
estimating/eliminating trend:
Method 1: Trend estimation
(first we estimate the trend either by
moving average smoothing or regression analysis –
then we remove it)
14
Method 1: Trend Estimation by
Regression Analysis
Estimate a trend line using regression analysis
Time Use time (t) as the
Period Sales independent variable:
Year (X)
(t)
2004 0 20
2005 1 40
2006 2 30 In least squares linear, non-linear, and
2007 3 50 exponential modeling, time periods are
numbered starting with 0 and increasing
2008 4 70 by 1 for each time period.
2009 5 65
15
Least Squares Regression
Without knowing the exact time series random error correlation structure,
one often resorts to the ordinary least squares regression method, not
optimal but practical. The estimated linear trend equation is:
Time
Year Period Sales
(t) (X)
Sales trend
2004 0 20
80
2005 1 40 70
60
2006 2 30 50
sales
40
2007 3 50 30
20
2008 4 70 10
0
2009 5 65
0 1 2 3 4 5 6
Year
16
Linear Trend Forecasting
One can even performs trend forecasting at this point – but bear in mind
that the forecasting may not be optimal.
• Forecast for time period 6 (2010):
Time
Year Period Sales
(t) (X)
2004 0 20 Sales trend
2005 1 40 80
70
2006 2 30
60
2007 3 50 50
sales
40
2008 4 70 30
20
2009 5 65
10
2010 6 ?? 0
0 1 2 3 4 5 6
Year
17
Method 2: Trend Elimination by
Differencing
18
Trend Elimination by Differencing
where
20
Classical Decomposition Model
Method 1: Filtering: First we estimate and remove the
trend component by using moving average method; then
we estimate and remove the seasonal component by
using suitable periodic averages.
Method 2: Differencing: First we remove the seasonal
component by differencing. We then remove the
trend by differencing as well.
Method 3: Joint-fit method: Alternatively, we can fit a
combined polynomial linear regression and harmonic
functions to estimate and then remove the trend and
seasonal component simultaneously as the following:
21
Method 1: Filtering
(1). We first estimate the trend by the moving average:
• If d = 2q (even), we use:
To ensure:
we further subtract the mean of
(3). One can also re-analyze the trend from the de-seasonalized data in
order to obtain a polynomial linear regression equation for modeling and
prediction
22 purposes.
Method 2: Differencing
Define the lag-d differencing operator as:
23
Method 3: Joint Modeling
As shown before, one can also fit a joint model
to analyze both components simultaneously:
24
Detrended series
26
White noise - example of a time
series model
27
Gaussian white noise
28
Stochastic properties of the process
STATIONARITY
29
WHEN A STOCHASTIC PROCESS IS STATIONARY?
{Xt} is a strictly stationary time series if
f(X1,...,Xn)= f(X1+h,...,Xn+h),
where n1, h – integer
Properties:
* The random variables are identically distributed.
* An idependent identically distributed (iid) sequence
is strictly stationary.
30
Weak stationarity
31
Autocorrelation function (ACF)
32
ACF for Gaussian WN
33
ARMA models
34
Examples
35
Exponential decay of ACF
MA(1) AR(1)
sample ACF
36
More examples of ACF
37
Reference
Box, George and Jenkins, Gwilym (1970) Time series analysis:
Forecasting and control, San Francisco: Holden-Day.
38