SSTA031 Lecture Notes
SSTA031 Lecture Notes
TURFLOOP CAMPUS
SSTA031
TIME SERIES ANALYSIS LECTURE NOTES
TIME SERIES ANALYSIS LECTURE NOTES 2023
COURSE DESCRIPTIVE
In this course we look at the applied issues of Time Series Analysis. We will combine theoretical work
with the use of computer techniques for model solution. The purpose of this series of lectures is to
provide students with sufficient background in modern Time Series Analysis to choose techniques
suited both to the data-source and the Time Series model. The course places some emphasis on the
link between Time Series theory and forecasting estimation and deals explicitly with interpretation and
critical appraisal of forecasting estimates.
LEARNING OUTCOMES
After successful completion of the module, the student should be able to :
i. Understand the basic theory of time series analysis and forecasting approaches;
ii. Synthesize the relevant statistical knowledge and techniques for forecasting;
iii. Use procedures in popular statistical software for the analysis of time series and forecasting;
iv. Interpret analysis results and make recommendations for the choice of forecasting methods;
v. Produce and evaluate forecasts for given time series;
vi. Present analysis results of forecasting problems.
Lecture Notes : A copy of Lecture notes will be available on UL blackboard. The notes do
not include proofs of stationarity/invertibility , so students are advised to
take additional notes in class.
2|Page
TIME SERIES ANALYSIS LECTURE NOTES 2023
READING LIST
Although lecture notes are provided, it is important that you reinforce this material by referring to more
detailed texts.
RECOMMENDED TEXTS
• Chris Chatfield (2004).The Analysis of Time Series, An Introduction, Six Edition, Chapman
& Hall/CRC.
• Cryer, D. C. and Chan, K (2008). Time Series Analysis with Application in R, 2nd Edition,
Springer.
• Wei W.W.S (2006) Time Series Analysis, Univariate and Multivariate Methods, Second
Edition, Pearson Addison Wesley.
SUPPLEMENTARY TEXTS
TIME SCHEDULE
The lecture topics within the semester are as in the following schedule:
3|Page
TIME SERIES ANALYSIS LECTURE NOTES 2023
NOTATIONS
Symbol Description
∇ ks Seasonal differencing
Ε( x ) Mean of x
(
N 1, σ 2 ) Normally distributed with mean 1 and variance σ 2
4|Page
TIME SERIES ANALYSIS LECTURE NOTES 2023
CONTENTS
_____________________________________________________
Course Descriptive 2
Notations 4
1.1 Introduction 9
5|Page
TIME SERIES ANALYSIS LECTURE NOTES 2023
2.1 Introduction 18
2.3.1 Transformations 20
2.4.1 Filtering 21
3.1 Introduction 23
3.5.1 MA(1) 26
3.5.2 MA(2) 26
3.5.3 MA( q ) 27
3.7.1 AR(1) 28
3.7.2 AR(2) 29
3.7.3 AR( p ) 30
3.10.1 ARMA(1,1) 34
3.10.2 Weights (ψ , π ) 34
5 Parameter Estimation 37
5.1 Introduction 37
5.2.1 Mean 37
6 Model Diagnostics 41
6.1 Introduction 41
7|Page
TIME SERIES ANALYSIS LECTURE NOTES 2023
7 Forecasting 44
7.1 MME 44
9 APPENDIX A 47
8|Page
TIME SERIES ANALYSIS LECTURE NOTES 2023
CHAPTER 1
INTRODUCTION TO TIME SERIES
1.1 Introduction
What is time series? A time series may be defined as a set of observations of a random variable
arranged in chronological (time) order. We also say it’s a series of observations recorded sequentially
at equally spaced intervals of time. Let us look at a few examples in order to appreciate what we
mean by a time series.
Example: 1.1.1
The daily temperature recorded over a period of a year. There are a time series because they are
recorded at equally spaced intervals of time and they are recorded regularly.
Example: 1.1.2
The hourly temperature readings of a machine in a factory constitutes a time series. The fact that the
temperature readings are taken every hour makes the temperature readings a time series.
Time series analysis attempts to isolate and quantify the influence of these different environmental
forces operating on the time series into a number of different components. This is achieved through a
process known as decomposition of the time series.
Once identified and quantified, these components are used to estimate future values of the time
series. An important assumption in time series analysis is the continuation of past patterns into the
future ( i.e the environment in which the time series occurs is stable.)
Notation:
• If T is discrete,we have a discrete time series,and T = ℜ ,the set of all integers. The time series
is some times written as ..., x − 2 , x −1 , x0 , x1 x 2 ,...
9|Page
TIME SERIES ANALYSIS LECTURE NOTES 2023
• For simplicity, we will drop the index set and write {xt } or {x1 , x 2 , x3 ,...} to indicate that they are
observation.
• In practice, the time series interval for collection of time series could be
seconds,minutes,hours,days,weeks,months,years or any reasonable regular time intervals.
• Remove the components to get stationary residuals by differencing the data.(i.e Replacing the
original series {xt }by y t = xt − xt −1 .
• Do the forecasting
A smooth or regular underlying movement of a series over a fairly long period of time. A gradual and
consistent pattern of changes.
10 | P a g e
TIME SERIES ANALYSIS LECTURE NOTES 2023
Movement in a time series which recur year after in some months or quarters with more less the
same intensity.
Period variations extending over a long period of time, caused by different factors such as cycles,
recession, depression, recovery, etc.
Variations caused by readily identifiable special events such as elections, wars, floods, earthquakes,
strikes, etc.
11 | P a g e
TIME SERIES ANALYSIS LECTURE NOTES 2023
A moving average (ma) of order M is produced by calculating the average value of a variable over a
set of M values of the series.
A running median of order M is produced by calculating the median value of a variable over a set of
M values of the series.
xˆ t +1 = β xt + (1 − β ) xˆ t
12 | P a g e
TIME SERIES ANALYSIS LECTURE NOTES 2023
• The three- year moving average would be each of these moving totals divided by 3.
• The five-year moving total for an observation x would be the sum of the two observations
immediately before x , x itself and the two observations immediately after x .
• The five-year moving average would be each of these moving totals divided by 5.
To illustrate the idea of moving averages, let us consider the observations in example 1.8.1
13 | P a g e
TIME SERIES ANALYSIS LECTURE NOTES 2023
Example: 1.8.1
Australia’s official development assistance (ODA) from 1984-85 until 1992-93 is shown (at current
prices, $ million) in Table 1 .
Table 1
Year ODA($
million)
1984-85 1011
1985-86 1031
1986-87 976
1987-88 1020
1988-89 1195
1989-90 1174
1990-91 1261
1991-92 1330
1992-93 1384
(a) Find the three- year moving averages to obtain the trend of the data.
Regression line is defined by: y = β 0 + β1 x . If the variable x , are not given, must be coded.
14 | P a g e
TIME SERIES ANALYSIS LECTURE NOTES 2023
• To code x when the number of time periods, n is even, we assign a value of − (n − 1) to the
first time period and for each subsequent period, add two to the previous period’s x value.
Example 1.8.2
Table 2
Y 2 6 1 5 3 7 2
Exercise: 1.8.1
Consider the monthly earning of a small business.
Table 3
Y 12 14 18 17 13 4 17
b) Find the least squares trend line for small business using Zero- sum method.
c) Find the least squares trend line for small business using sequential method.
15 | P a g e
TIME SERIES ANALYSIS LECTURE NOTES 2023
The moving average approach is used to isolate the trend/cyclical movement in a time series.
Step-2
Actual y y
seasonal ratio = × 100% = t × 100%
Moving average series MA
T ×C × S × I
= = S × I × 100%
T ×C
Seasonal ratio is an index which expresses the percentage deviation of each actual y(which includes
seasonal influences) from its moving average value(which contains trend and cyclical influences
only).
Step-3
Average the seasonal ratios across corresponding periods within each year.
The averaging of seasonal ratios has the effect of smoothing out irregular component inherent in the
seasonal ratios. Generally, the median is used to find the average of seasonal ratios for correspond
periods.
Step-4
k × 100
Adjusted factor =
∑ (Median seasonal indices )
De-seasonalising the actual time series
Seasonal influences may be removed from a time series by dividing the actual y value for each
period by its corresponding seasonal index.
Actual y
That is, Deseasonalised y = × 100
Seasonal index
16 | P a g e
TIME SERIES ANALYSIS LECTURE NOTES 2023
Example: 1. 9.1
The average daily sales (in litres) of milk at a country store are shown in Table 4 for each of the years
1983 to 1985.
Table 4
1 47.6
2 48.9
1983 3 51.5
4 55.3
1 57.9
1984 2 61.7
3 65.3
4 70.2
1 76.1
1985 2 84.7
3 93.2
4 97.2
(b) Calculate the seasonal index by making use of the ratio-to-moving average method.
Exercise: 1.9.1
Table 5
Quarter 1 2 3 4 1 2 3 4
actuals 10 20 30 16 29 45 25 50
17 | P a g e
TIME SERIES ANALYSIS LECTURE NOTES 2023
CHAPTER 2
THE MODEL BUILDING STRATEGY
2.1 Introduction
Perhaps the most important question we ask now is “how do we decide on the model to use?”
Finding appropriate models for time series is not an easy task. We will develop a model building
strategy which was developed by Box and Jenkins in 1976.
1) Model specification
2) Model fitting.
3) Model diagnostics.
Definition 2.2.1 (The principle of parsimony) :The model used should require the smallest possible
number of parameters that will adequately represent the data.
18 | P a g e
TIME SERIES ANALYSIS LECTURE NOTES 2023
2
ρ̂ k < (i.e the sample ACF must be within the boundaries).
n
Example 2.2.1
200 observations on a stationary series were analyzed and gave the following sample
autocorrelation:
Table 6
k 1 2 3 4 5
If no in adequacies are found, the modeling may be assumed to be complete, and the model can be
used, for example, to forecast future values of the series. Otherwise we choose another model in light
of the inadequacies found: that is we return to model specification. In this way we cycle through the
three steps until an acceptable model is found.
It should be noted that in real life it is not often the case that a stochastic process is stationary. This
could arise due to, for example,
2.3.1 Transformations
If the process is not stationary to analyze its series we must transform the series to be stationary.
There are various transformations that we can use to make a time series stationary. Some of them
are:
1) Differencing.
2) Log transformation.
4) Arcsine transformation.
5) Power transformation.
If the variance of the series increases with the mean in the presence of trend, then it is advisable to
transform the data. A logarithmic transformation is appropriate if the standard deviation is directly
proportional to the mean.
If size of the seasonal effect appears to increase with the mean in the presence of the trend, then it is
advisable to transform the data so as to make the seasonal effect ADDITIVE. If the size of the
seasonal effect is directly proportional to the mean, then the seasonal effect is said to be
Multiplicative and the logarithmic transformation is appropriate to make the seasonal effect additive.
Often the general class of transformations called the Box-Cox transformation given by
Yt =
( λ
)
xt − 1
,λ ≠ 0
λ
log xt ,λ =0
For some transformation parameter λ. the logarithmic and square root transformations are special
cases of this general class.
20 | P a g e
TIME SERIES ANALYSIS LECTURE NOTES 2023
In that situation we continue differencing the series until it is stationary. Once the process is
stationary there is no need to continue differencing it otherwise we will over difference it.
Exercise 2.3.1
Suppose we have a process given by xt = 5 + 2t + z t where z t is white noise with mean zero and
variance σ z2 .
xt → Filter → y t
z t = ∑ b j yt + j
j
= ∑ b j ∑ a r xt + j + r
j r
= ∑ c k xt + k
k
where c k = ∑ a r b(k − r )
r
21 | P a g e
TIME SERIES ANALYSIS LECTURE NOTES 2023
, are the weights for the overall filter. The weights {c k } are obtained by a procedure called
convolution and symbolically expressed as {c k } = {a r }* {b j }
Example: 2.4.1
1 1 1 1
(a) Consider the following two filters: A = , , B = , Compute A * B where *denotes the
2 2 2 2
convolution operator.
(b) Consider the following two filters: A = {− 1,1}, B = {− 1,1}Compute A * B where *denotes the
convolution operator.
Exercise: 2.4.1
Calculate the convolution of the following filters:
1 1 1 1 1 1 1 1
a) , , , * , , ,
4 4 4 4 4 4 4 4
1 1 1 1 1 1 1
b) , , , * , ,
4 4 4 4 3 3 3
Definition 2.5.2: Let {xt , t ∈ T }be a stochastic process and let ε be a set of all possible realization or
sample of path then ε is called the ensemble for the process {xt }. An individual time series is a
member of ensemble.
Remarks: In time series literature, the terms “time series” and process are used (often)
interchangeably.
22 | P a g e
TIME SERIES ANALYSIS LECTURE NOTES 2023
CHAPTER 3
MODELS FOR STATIONARY TIME SERIES
3.1 Introduction
In order to be able to analyze or make meaningful inference about the data generating process it is
necessary to make some simplifying and yet reasonable assumption about the process. A
characteristic feature of time series data which distinguishes it from other types of data is that the
observations are, in general, correlated or dependent and one principal aim of time series is to study,
investigate, explore and model this unknown correlation structure.
Example: 3.1.1
Let n=1, the distribution of xt is strictly stationary if µ t = µ and σ t = σ are both constant. And if n=2,
2
the joint distribution of xt 1 and xt 2 depend only on (t 2 − t1 ), which is called the lag. Thus the
autocovariance function γ (t1 ,t 2 ) depends only on (t 2 − t1 ) and is written as γ (k ) , where
γ (k ) = Ε{[xt − µ ][xt + k − µ ]}
And γ (k ) is called the autocovariance coefficient at lag k.
= cov( xt , xt + k )
Example: 3.1.2
Prove or disprove the following process is covariance stationary:
(a) z t = (− 1) A , where A is a random variable with zero mean and unit variance?
t
23 | P a g e
TIME SERIES ANALYSIS LECTURE NOTES 2023
Exercise: 3.1.1
Consider the following time sequence xt = z0 cos(ct ) .
Where {z0 } is a sequence of independent normal r.v with mean 0 and variance σ z2 .
Properties
1. The ACF is an even function, so that ρ (k ) = ρ (− k ) i.e. the correlation between x(t ) and x(t + k ) is the
same as the correlation between x(t ) and x(t − k ) .
2. ρ (k ) ≤ 1
3. The ac.f does not uniquely identify the underlying model. That is why invertibility has to be checked
in moving average processes.
Exercise: 3.2.1
Prove the following:
a) ρ (k ) = ρ (− k )
b) ρ (k ) ≤ 1
24 | P a g e
TIME SERIES ANALYSIS LECTURE NOTES 2023
Definition 3.3.1: A discrete time process is called a purely random process (white noise) if it
consists of a sequence of random variable {z t } which are mutually independent and identically
distributed. It follows that both mean and variance are constants and the acv.f. is:
γ (k ) = cov(z t , z t + k )
= 0 for k = ±1,2...
1 , for k = 0
The ac.f.is given by ρ (k ) =
0 , for k = ±1,±2,...
A process {xt } is said to be an IID noise with mean 0 and variance σ x2 ,written {xt }~ IID(0, σ x2 ) if the
random variable xt are independent and identically distributed with Ε( xt ) = 0 and var( xt ) = σ x2 .
x1 = z1
x 2 = z1 + z 2
x3 = z1 + z 2 + z 3
xt = z1 + z 2 + z 3 + + z t .................(∗)
If z' s are interpreted as the size of ‘steps’ taken forward or backward at time t , then xt is the position
of a ‘random walk’ at time t .
From (∗) we obtain the mean function: µ t = Ε( xt ) = 0 , variance of xt , var( xt ) = t σ z2 and the
covariance of xt and x s , γ t , s = cov(xt , x s ) = t σ z2 .
Backshift operator
The backshift operator is used to express and manipulate time series models. The backshift operator
denoted B on the time index of a series and shifts time back 1 time unit to form a new series i.e:
B( xt ) = xt −1 .
25 | P a g e
TIME SERIES ANALYSIS LECTURE NOTES 2023
xt ⇒ moving average ⇒ z t , z t −1
Schematically, a moving average of order 1 can be expressed as
operator ( filter )
The second order moving average process is defined by xt = z t − θ1 z t −1 − θ 2 z t − 2 and is stationary for all
values of θ1 and θ 2 .However , it is invertible only if the roots of the characteristic equation
1 − θ1 B − θ 2 B 2 = 0 lie outside the unit circle, that is ,
(i ) θ 2 + θ 1 < 1
(ii ) θ 2 − θ 1 < 1
(iii ) − 1 < θ 2 < 1
Example: 3.5.2
Find the variance and ACF of the following process:
xt = z t − θ1 z t −1 − θ 2 z t − 2
26 | P a g e
TIME SERIES ANALYSIS LECTURE NOTES 2023
Solution:
(
(a) The variance of the process is γ (0 ) = σ z 1 + θ 21 + θ 2 .
2 2
)
− θ1 (1 − θ 2 )
(b) The ACF’s are ρ1 =
1 + θ1 + θ 2
2 2
−θ2
ρ2 =
1 + θ1 + θ 2
2 2
ρ3 = 0 for k ≥ 3
Exercise: 3.5.1
Find the ACF of the following first order MA processes:
(a) xt = z t + θ1 z t −1
1
(b) xt = z t + z t −1 ,where z t is a white noise.
θ
a process {xt }is said to be a moving average process of order q (abbreviated as MA (q)) if
xt = z t + θ1 z t −1 + ... + θ q z t − q .Where {θ i }are constants.
Example: 3.5.3
Consider a MA (q) given by xt = z t + θ1 z t −1 + ... + θ q z t − q .
Exercise: 3.5.2
Find the ACF of the first-order moving average given by xt = z t − θ1 z t −1 .
27 | P a g e
TIME SERIES ANALYSIS LECTURE NOTES 2023
ρ 0 ρ1 ρ1
ρ1 ρ 0 ρ 2
Φ 11 = ρ1
ρ 2 ρ1 ρ 3
, Φ 33 =
ρ 0 ρ1 ρ 2
ρ0 ρ1
ρ1 ρ 0 ρ1
ρ ρ2
Φ 22 = 1 ρ 2 ρ1 ρ 0
ρ0 ρ1
ρ1 ρ0
Exercise 3.6.1
Find the Φ 11 , Φ 22 , Φ 33 of xt = z t + θ1 z t −1 .
ˆ kk = 1
Definition 3.6.2: Standard error for Φ
n
Example: 3.7.1
Consider a model xt = φ1 xt −1 + z t where xt is a white noise.
Solution:
The first-order autoregressive process is xt = φ1 xt −1 + z t where φ1 must satisfy the following condition:
− 1 < φ1 < 1 for the process to be stationary.
28 | P a g e
TIME SERIES ANALYSIS LECTURE NOTES 2023
Using the backward shift operation B, the process xt = φ1 xt −1 + z t may be written as (1 − φ1 B )xt = z t so
−1
( 2
)
that xt = (1 − φ1 B ) z t = 1 + φ1 B + φ1 B 2 + ... Z t = z t + φ1 z t −1 + φ1 z t − 2 + ...
2
Ε[xt ] = 0
2
(
var(xt ) = σ z 1 + φ1 + φ1 + ...
2 4
)
σ z2
Thus the variance is finite provided that φ1 < 1 , in which case var( xt ) = σ x =
2
.
1 − φ1
2
a
i.e s ∞ = 1 − r , where
φ1 4 φ1 2
= = = φ1
2
r
φ1 2
1
and a = 1
φ1 k σ z 2
This converges for φ1 < 1 to γ (k ) = = φ1 σ x
k 2
(
1 − φ1 )
2
⇒ ρ (0 ) = 1
ρ (1) = φ1
Exercise: 3.7.1
Consider a model xt = 0.7 xt −1 + z t where z t is a white noise.
xt = φ1 xt −1 + φ 2 xt − 2 + z t .
For stationarity, the roots of φ (B ) = 1 − φ1 B − φ 2 B 2 = 0 must lie outside the unit circle, which implies that
the parameters φ1 and φ 2 must lie in the triangular region:
(i ) φ 2 + φ1 < 1
(ii ) φ 2 − φ1 < 1
(iii ) − 1 < φ 2 < 1
Stationary conditions:
The roots Bi , i = 1,2..., p of the characteristic equation 1 − φ1 B − φ 2 B 2 − ... − φ P B p = 0 must lie outside the
unit circle.
condition condition
30 | P a g e
TIME SERIES ANALYSIS LECTURE NOTES 2023
Example: 3.7.2
Theoretical behavior of the ACF and PACF for AR(1) and AR(2) models:
AR(1): PACF = 0 for lag > 1 ; ACF → 0 AR(2 ): PACF = 0 for lag > 2 ; ACF → 0
In this context………..
• “damps out/die out” means” tend to zero gradually”
• “cuts off” means ”disappear” or “is zero”.
Example: 3.7.3
Theoretical behavior of the ACF and PACF for MA(1) and MA(2) models:
MA(1): ACF = 0 for lag > 1 ; PACF → 0 MA(2 ): ACF = 0 for lag > 2 ; PACF → 0
31 | P a g e
TIME SERIES ANALYSIS LECTURE NOTES 2023
The general solution is ρ (k ) = A1π 1 + ... + A p π p where {π i },are the roots of the auxiliary equation:
k k
y p − φ1 y p −1 − ... − φ p
The first ( p − 1) Yule-Walker equations provide ( p − 1) further restrictions on the {Ai } using
ρ (0) = 1 and ρ (k ) = ρ (− k ) .From the general form of ρ (k ) , it is clear that ρ (k ) tends to zero as k
increases provided that π i < 1 for all i , and this is a necessary and sufficient condition for the process
to be stationary.
For stationary, the roots of the equation φ (B ) = 1 − φ1 B − ... − φ p B p = 0 must lie outside the unit circle.
Example: 3.9.1
Suppose we have AR (2) process, when π 1 , π 2 are the roots of the quadratic equation y 2 − φ1 y − φ 2 = 0
, thus π i < 1 if φ1 ±
(φ
1
2
+ 4φ 2 ) < 1.
2
32 | P a g e
TIME SERIES ANALYSIS LECTURE NOTES 2023
φ1
−π2
1 − φ 2
Where A1 = and A2 = 1 − A1
π1 − π 2
Example: 3.9.2
1
Consider the AR (2) process given by x t = − x t −1 − xt −2 + z t
4
Exercise: 3.9.1
1 2
Consider the AR (2) process given by xt = xt −1 + xt − 2 + z t
3 9
______________________________________________________________________
Note: for real –valued linear different, a complex root of φ (B ) = 0 must appear in pairs.
That is, if (c + di ) is a root, then its complex conjugate (c + di ) = (c − di ) is also a root. A general
*
________________________________________________________________________________
33 | P a g e
TIME SERIES ANALYSIS LECTURE NOTES 2023
Stationary process
Invertible process
Example: 3.10.1
1
Consider the following process: xt − xt −1 = z t + 2 z t −1 .
2
3.10.2 Weights (ψ , π )
From the relations ψ 1 = φ1ψ 0 − θ1 = φ1 − θ1 andψ j = φ1ψ j −1 for j > 1 , we find that the ψ j weights are
given by ψ j = (φ1 − θ1 )φ1 , for j ≥ 1, and similarity it is easily seen that π j = (φ1 − θ1 )θ1
j −1 j −1
, for j ≥ 1 ,for
the stationary and ARMA (1, 1) process.
Example: 3.10.2
Find the ψ weights and π weights for the ARMA (1, 1) process given by xt = 0.5 xt −1 + z t − 0.3 z t −1 .
34 | P a g e
TIME SERIES ANALYSIS LECTURE NOTES 2023
Exercise: 3.10.1
1
Consider the ARMA (1,1) process given by xt = xt −1 + z t + z t −1
2
Exercise: 3.10.2
Obtain the first 3π -weights and 3ψ -weights of the following models:
a) (1 − φ1 B − φ 2 B 2 ) xt = (1 − θ B ) z t .
( )
b) 1 − 3B + B 2 xt = z t
Definition 3.11.1: A process {xt } is called a seasonal ARMA process of non seasonal order p, q and
seasonal component P, Q and a seasonality order S if {xt } satisfies φ (B ) Φ (B ) xt = θ (B ) Θ(B ) z t .
Where,
Φ (B ) = 1 − Φ B S − Φ 2 B 2 S − − Φ P B PS
φ (B ) = 1 − φ B − φ 2 B 2 − − φ p B p
θ (B ) = 1 − θ 1 B − θ 2 B 2 − − θ q B q
Θ(B ) = 1 − Θ1 B S − Θ 2 B 2 S − − Θ Q B QS
CHAPTER 4
MODEL FOR NON STATIONARY SERIES
Note: If we want to check whether an ARMA( p, q ) is stationary we check the AR( p ) part only.
35 | P a g e
TIME SERIES ANALYSIS LECTURE NOTES 2023
ARMA ( p, q ) model for wt , while the model in equation above, describing the dth differences of xt , is
said to be an ARIMA process of order ( p, d , q ) .The model for xt is clearly non-stationary, as AR
operator φ (B )(1 − B ) had d roots on the unit circle. If the value of d is taken to be one, the random
d
Exercise: 4.1.1
Identify the following models
a) (1 − 0.8 B )(1 − B ) xt = z t .
b) (1 − B ) xt = (1 − 0.75)z t .
Φ (B ) = 1 − Φ B S − Φ 2 B 2 S − − Φ P B PS
φ (B ) = 1 − φ B − φ 2 B 2 − − φ p B p
Where:
θ (B ) = 1 − θ 1 B − θ 2 B 2 − − θ q B q
Θ(B ) = 1 − Θ1 B S − Θ 2 B 2 S − − Θ Q B QS
Example: 4.2.1
Let consider a time series where a period consists of S seasons (for monthly data S = 12 , for
quarterly data S = 4 ,etc.)
Suppose a non-seasonal ARIMA model is fitted to the series i.e φ p (B )(1 − B ) xt = θ q (B )at ....... ∗
d
where at is a white noise. This series can also be represented as ARIMA model
( )(
ΦP BS 1− BS )D
( )
at = Θ Q B S bt .............. ∗ ∗
36 | P a g e
TIME SERIES ANALYSIS LECTURE NOTES 2023
( ) ( )
where Φ P B S = 1 − Φ 1 B S − Φ 2 B 2 S − ... − Φ P B PS and Θ Q B S = 1 − Θ1 B S − Θ 2 B 2 S − ... − Θ Q B QS
( ) ( )
It is assumed that the polynomials Φ P B S and Θ Q B S have no common roots and that their roots
lie outside the unit circle.
Example: 4.2.2
Let us consider the ARIMA(0,1,1) × (0,1,1)12 model. Where Wt = (1 − B )(1 − B 12 ) xt = (1 − θB )(1 − ΘB 12 ) z t .
CHAPTER 5
PARAMETER ESTIMATION
5.1 Introduction
Having tentatively specified ARIMA( p, d , q ) the next step is to estimate the parameters of this model.
This chapter focuses on estimation of parameters of an AR and MA models. We shall deal with the
most commonly used method of estimating parameters, these are:
1) Method of moments.
3) Maximum-likelihood method.
5.2.1 Mean
With only a single realization (of length n ) of the process, a natural estimator of the mean, µ is the
1 n
sample mean x = ∑ xt .where x is the average time average of n observation.
n t =1
37 | P a g e
TIME SERIES ANALYSIS LECTURE NOTES 2023
1 n
Since E ( x ) = ∑ E (xt ) = µ , x is an unbiased estimator of µ
n t =1
γ (0) n −1
k
var( x ) = 1 + 2∑ 1 − ρ (k )
n k =1 n
ESTIMATION OF γk and ρk
Suppose that we have n observations x1 , x2 ,, xn then the corresponding sample autocovariance
and autocorrelation functions (or estimates) at lag k are:
n−k
1 n−k ∑ (x t − x )( xt + k − x )
γˆk = ∑ (xt − x )(xt + k − x ) and ρ̂ k = t =1
n
∑ (x − x)
n t =1 2
t
t =1
n −1
1 n −1 ∑ (x t − x )( xt +1 − x )
As an example, γˆ1 = ∑ ( xt − x )( xt +1 − x ) and ρ̂1 = t =1
n
are used to estimate γ 1 and ρ1 .
∑ (x − x)
n t =1 2
t
t =1
Example: 5.2.1a
Table 8
t 1 2 3 4
xt 4 5 2 5
Example: 5.2.1b
Suppose that {xt } is a MA(1) process defined by xt = z t + θ z t −1 where θ is a fixed parameter and
( )
z t ~ IID 0, σ Z . Where IID stand for Independent Identically Distributed noise.
2
Exercise: 5.2.1
38 | P a g e
TIME SERIES ANALYSIS LECTURE NOTES 2023
Suppose that {xt } is moving average process given by xt = (z t + z t −1 + z t −2 ) where {z t } is zero mean
1
3
white noise with var( z t ) = σ z2 . Calculate var( x ) .
Example: 5.2.2
Consider an AR(1) model: xt = φ1 xt −1 + z t Find the estimate of φ1 using the method of moments.
Exercise: 5.2.2
Consider an AR(2 ) model: xt = φ1 xt −1 + φ 2 xt − 2 + z t Find the estimates φ1 and φ 2 using the method of
moments.
Example: 5.2.3
Consider an MA(1) model: xt = z t − θ1 z t −1 Find the estimate of θ1 using the method of moments.
n∑ xt y t − ∑ xt ∑ y t
The Least Square Estimate is given by: φˆ =
n∑ xt2 − (∑ xt )
2
The estimate φ is a consistant and best linear unbiased estimator of φ . This holds under the
following basic assumptions on the error term z t :
1) Zero mean: Ε( z t ) = 0 .
2) Constant variance: Ε( z t ) = σ z2 .
2
39 | P a g e
TIME SERIES ANALYSIS LECTURE NOTES 2023
In the next subsection we shall apply the LSE method to time series model.
Example: 5.3.1
Consider an AR(1) model: xt = φ1 xt −1 + z t ….*
Model *can be viewed as a regression model with predictor variable xt −1 and responded variable xt .
On LSE method we minimize the sum of squares of the difference xt − xt −1 that is
S (φ ) = ∑ z t2 = ∑ ( xt − φ xt −1 )
2
d S (φ )
Consider the minimization of S (φ ) with respect to φ we have = −2∑ [xt − φ xt −1 ] xt −1 ............... * *
d (φ )
[ ]
Setting this equal to zero and solving for φ yields − 2∑ xt − φˆ xt −1 xt −1 = 0 ⇒ φˆ =
∑x t −1 xt
.
2
x t −1
Example: 5.3.2
Consider an AR(1) model: xt − µ = φ ( xt −1 − µ ) + z t .
Exercise: 5.3.1
Consider an AR(2 ) model: xt − x = φ1 ( xt −1 − x ) + φ 2 ( xt − 2 − x ) + z t Find the estimates φ1 and φ 2 using
the LSE method .
40 | P a g e
TIME SERIES ANALYSIS LECTURE NOTES 2023
If γ 0 and the ρ k ' s are known then a 100(1 − α ) percent confidence interval for µ is
γ0 k α
X ± zα 1 + 2∑ 1 − ρ k . Where z α is upper quantile from the standard normal distribution.
2
n n 2
2
γ0
Note that if ρ k = 0 for all k ,then this confidence interval formula reduces to X ± z α .
2
n
Example 5.4.1
Suppose that in a sample of size 100 from AR(1) : x t = φ1 x t −1 + z t process with mean µ ; φ = 0.6 and
σ 2 = 2 we obtain X 100 = 0.271
Exercise 5.4.1
Suppose that in a sample of size 100 from MA(1) process with mean µ ; φ = −0.6 and σ 2 = 1 we obtain
X 100 = 0.157 .
CHAPTER 6
MODEL DIAGNOSTICS
6.1 Introduction
Model diagnostics is primarily concerned with testing the goodness of fit of a tentative model. Two
complementary approaches are: Analysis of residuals from fitted models and analysis of over
parameterized model will be considered in this chapter.
41 | P a g e
TIME SERIES ANALYSIS LECTURE NOTES 2023
Residual can be used to assess if the ARMA is adequate and if the parameter estimates are close to
the true values. Model adequacy is checked by assessing whether the model assumptions are
satisfied.
The basic assumption is that , {z t } are white noise .That is they possess the properties of
independence, identically and normally distributed random variables with zero mean and constant
variance σ z2 .
A good model is one with residuals that satisfy these properties, that is, it should have residuals
which are:
3) Constant variance.
-Examining ACF: Compute the sample ACF of the residual. Residuals are independent if they do not
form any pattern and are statistically insignificant, that is, they are within Z α standard deviation.
2
Histogram of normally distributed residuals should approximately be symmetric and bell shaped.
42 | P a g e
TIME SERIES ANALYSIS LECTURE NOTES 2023
Hypothesis
Decision rule: Reject H 0 if Q > χ k2,1−α and conclude that the random term {z t } from the estimated
model are correlated and that the estimated model may be inadequate.
Note: The maximum lag K is taken large enough so that the weights are negligible for j > K .
k =1
Example: 6.2.1
From example 5.2.1a, calculate the value of Q if k = 1 .
Example: 6.2.2
The AR(2 ) model xt = C + α 1 xt −1 + α 2 xt − 2 + z t was fitted to a data set of length 121.
24
a) The Box-Pierce statistic value was Q = 121∑ ρˆ k2 = 31.5
k =1
At 95% level of significance, test the hypothesis that AR(2 ) model fit the data.
43 | P a g e
TIME SERIES ANALYSIS LECTURE NOTES 2023
The last four values in the series were 707, 6.90, 6.63, 6.20 .
There is no unique way to over fit a model, but one should be careful not to add coefficients to both
sides of the model. Over fitting both AR and MA terms at the same time leads to estimation problems
because of the parameter redundancy as well as violating the principle of parsimony.
If our tentative model is AR(2 ) we might over fit with AR(3) . The original AR(2 ) will be confirmed if :
1) The estimates of the additional parameter φ3 is not significantly different from zero.
2) The estimates for the parameters φ1 and φ 2 do not change significantly from the original
states.
CHAPTER 7
FORECASTING
Example: 7.1.1
(
Let ψ (B ) = φ (B )Wt = φ (B )(1 − B ) = 1 − ψ 1 B − ... − ψ p + q B p + d
d
)
7.1.1 ARMA model forecast equation in infinite MA form
Assume that we have x1 , x 2 ,..., x n and we want to forecast x n +l (i.e l step-ahead forecast from origin,
the actual value is: x n +l = ψ 1 z n +l −1 + ψ 2 z n +l − 2 + ... + z n +l .
44 | P a g e
TIME SERIES ANALYSIS LECTURE NOTES 2023
This form is not very useful for computing forecasts, but is useful in finding the forecast error.
en (1) = x n +1 − xˆ n (1) = z n +1
en (2 ) = x n + 2 − xˆ n (2 ) = z n + 2 + ψ 1 z n +1
en (3) = x n +3 − xˆ n (3) = z n +3 + ψ 1 z n + 2 + ψ 2 z n +1
en (l ) = x n +l − xˆ n (l ) = z n +l + ψ 1 z n +l −1 + ... + ψ l −1 z n +1
( )
l −1
var[en (l )] = σ z 1 + ψ 1 + ψ 2 + ... + ψ l −1 = σ z ∑ψ where ψ 0 ≡ 1 .
2 2 2 2 2 2
i
i =0
45 | P a g e
TIME SERIES ANALYSIS LECTURE NOTES 2023
Example: 7.4.1
For each of the following models,
MA(1) process: xt = z t − θ z t −1 .
Exercise: 7.4.1
For each of the following models,
AR(2 ) process: xt = φ1 xt −1 + φ 2 xt − 2 + z t .
MA(1) process: xt = z t − θ1 z t −1 − θ 2 z t − 2 .
Example: 7.5.1
For (1 − φ B )( xt − µ ) = (1 − θ B ) z t
Exercise: 7.5.1
Consider the model (IMA (1,1)) : (1 − B ) x t = (1 − θ B ) z t .
Calculate:
46 | P a g e
TIME SERIES ANALYSIS LECTURE NOTES 2023
b) ψ − weight of xt .
47 | P a g e
TIME SERIES ANALYSIS LECTURE NOTES 2023
APPENDIX A
48 | P a g e
TIME SERIES ANALYSIS LECTURE NOTES 2023
________________________________________________________________________________________
49 | P a g e