0% found this document useful (0 votes)
12 views45 pages

Lecture 17

This document summarizes stochastic hydrology concepts taught in Lecture 17 of a course. It discusses: 1. Model selection methods like mean square error and maximum likelihood rule for AR and MA processes. 2. ARIMA model parameter estimation, forecasting, and error calculation. 3. ARIMA model validation tests to examine residual assumptions like having zero mean, no periodicities, and being uncorrelated. These include significance tests, Bartlett's test, and Whittle's and Portmanteau tests.

Uploaded by

Fofo Elorfi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views45 pages

Lecture 17

This document summarizes stochastic hydrology concepts taught in Lecture 17 of a course. It discusses: 1. Model selection methods like mean square error and maximum likelihood rule for AR and MA processes. 2. ARIMA model parameter estimation, forecasting, and error calculation. 3. ARIMA model validation tests to examine residual assumptions like having zero mean, no periodicities, and being uncorrelated. These include significance tests, Bartlett's test, and Whittle's and Portmanteau tests.

Uploaded by

Fofo Elorfi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 45

INDIAN

 INSTITUTE  OF  SCIENCE  

STOCHASTIC HYDROLOGY
Lecture -17
Course Instructor : Prof. P. P. MUJUMDAR
Department of Civil Engg., IISc.
Summary  of  the  previous  lecture  

• Behavior of AR and MA process


• Parameter estimation
– Matlab function armax
• Model selection
– Maximum likelihood rule

2  
ARIMA Models
Mean square error, MSE (Prediction approach):

• Using a portion of available data (N/2) estimate the


parameters of different models
• Forecast the series one step ahead by using the
candidate models
• Estimate the MSE corresponding to each model
• The model with least value of MSE is selected for
prediction

3  
ARIMA Models
The one step ahead forecast for ARMA(p, q) is
p q
Xˆ t +1 = ∑ φ j X t − j + ∑ φ j et − j
j =1 j =1

The error for one step ahead forecast is


et +1 = X t +1 − Xˆ t +1

If the series consists on N observations, the first N/2


observations are used for parameter estimation and N/
2+1 to N are used for error series calculation.

4  
ARIMA Models
The MSE for model is
N

∑ ei2
N
i= +1
2
MSE =
N 2

5  
ARIMA Models
3. Model testing / Validation:

Calibration data Test data

X1 XT-2 XT-1 X XT+1 XN


T

First T values are used to build the model (say 50%


of the available data) and the rest of data is used to
validate the model.

All the tests are carried out on the residual series only.

6  
ARIMA Models
The tests are performed to examine whether the
following assumptions used in building the model are
valid for the model selection
• The residual series has zero mean
• No significant periodicities are present in the
residual series
• The residual series is uncorrelated
⎛ m1 m2
⎞
et = X t − ⎜ ∑ φ j X t − j + ∑θ j et − j ⎟
Residual   ⎝ j =1 j =1 ⎠
Data  
Simulated from the model  

7  
ARIMA Models
Validation tests are listed here

• Significance of residual mean


• Significance of periodicities
• Cumulative periodogram test or Bartlett s test
• White noise test
• Whittle s test
• Portmanteau test

8  
Significance of residual mean
Significance of residual mean:

• This test examines the validity of the assumption


that the error series e(t) has zero mean
• A statistic η(e) is defined as
1/2
N e
η ( e ) = 1/2
ρˆ
Where
e is the estimate of the residual mean
ρ̂ is the estimate of the residual variance
Ref: Kashyap R.L. and Ramachandra Rao.A, Dynamic stochastic models from empirical
data , Academic press, New York , 1976   9  
Significance of residual mean
• The statistic η(e) is approximately distributed as t
(α, N–1), where α is the significance level at
which the test is being carried out.
• If the value of η(e) < t(α, N–1), then the mean of
the residual series is not significantly different
from zero – series passes the test.

10  
Significance of periodicities
Significance of periodicities:

• This test ensures that no significant periodicities


are present in the residual series
• The test is conducted for different periodicities
and the significance of each of the periodicities is
tested.
• A statistic η(e) is defined as
γ k2 ( N − 2 )
η (e) =
4 ρˆ1
γk corresponds to the periodicity being tested  
11  
Significance of periodicities
Where γk2= αk2 + βk2
2
1 ⎡ N ⎤
ρˆ1 = ⎢∑ et − αˆ cos (ωk t ) − βˆ sin (ωk t )
{ } ⎥
N ⎢⎣ t =1 ⎥⎦
2 n
α k = ∑ et cos (ωk t )
N t =1
2 n
β k = ∑ et sin (ωk t )
N t =1
2π/ωk is the periodicity for which test is being carried
out.

12  
Significance of periodicities
• The statistic η(e) is approximately distributed as
Fα(2, N–2 ), where α is the significance level at
which the test is being carried out.
• If the value of η(e) < Fα(2, N–2 ), then the
periodicity is not significant.

13  
Bartlett s test
Cumulative periodogram test or Bartlett s test :

• This test is also carried out to examine significant


periodicities in the residual series

• This test is more convenient computationally and


is preferred because of its ability to test all the
periodicities at a time.

14  
Bartlett s test
N 2 N 2
2 ⎧ 2 ⎫ ⎧ 2 ⎫
γ = ⎨ ∑ et cos (ωk t )⎬ + ⎨ ∑ et sin (ωk t )⎬
k
⎩ N t =1 ⎭ ⎩ N t =1 ⎭
k = 1,2,……N/2
k
2
∑ j
γ
j =1
gk = N /2 0 < gk < 1  
2
∑ k
γ
k =1

The plot of gk vs k is called as cumulative periodogram

Ref: Kashyap R.L. and Ramachandra Rao.A, Dynamic stochastic models from empirical
data , Academic press, New York , 1976   15  
Bartlett s test
• On the cumulative periodogram two confidence
limits (λ/(N/2)1/2) are drawn on either side of line
joining (0, 0) and (N/2, 1)
• The value of λ prescribed for 95% confidence limits
is 1.35 and for 99% confidence limits is 1.65
• If all the values of gk lie within the significance band,
there is no significant periodicities in the series.
• If a value of gk lies outside the significance band, the
periodicity corresponding to that value of gk is
significant.

16  
Bartlett s test
1  

gk  
λ
N
2
λ
N
2

0     N/2    
k    

17  
Whittle s test for white noise
White noise test (Whittle s test):

• This test is carried out to test the absence of


correlation in the series.
• The covariance rk at lag k of the error series e(t)
N
1
rk = ∑ee j j −k k = 0, 1, 2,…….kmax  
N −k j = k +1

• The value of kmax is normally chosen as 0.15N

Ref: Kashyap R.L. and Ramachandra Rao.A, Dynamic stochastic models from empirical
data , Academic press, New York   18  
Whittle s test for white noise
• The covariance matrix is

⎡ r0 r1 r2 . . rkmax ⎤
⎢ ⎥
⎢ r1 r0 r1 . . rkmax −1 ⎥
⎢ r ⎥
Γ n1 = ⎢ 2 ⎥
⎢ . ⎥
⎢ ⎥
⎢ . ⎥
⎢ rk rkmax −1 r0 ⎥⎦ k x k  
⎣ max max max

19  
Whittle s test for white noise
• A statistic η(e) is defined as
N ⎛ ρˆ0 ⎞
η (e) = ⎜ − 1⎟ n1 = kmax  
n1 − 1 ⎝ ρˆ1 ⎠
Where ρ̂ 0 is the lag zero correlation =1, and

det Γ n1
ρˆ1 =
det Γ n1−1
The matrix Γn1-1 is constructed by eliminating the
last row and the last column from the Γn1 matrix.

20  
Whittle s test for white noise
• The statistic η(e) is approximately distributed as
Fα(n1, N–n1 ), where α is the significance level at
which the test is being carried out.
• If the value of η(e) < Fα(n1, N–n1 ), then the
residual series is uncorrelated.

21  
Portmanteau test for white noise
White noise test (Portmanteau test):

• This test is also carried out to test the absence of


correlation in the series.
• This test also uses the covariance rk defined
earlier.
• A statistic η(e) is defined as
2
n1
⎛ rk ⎞
η ( e ) = ( N − n1) ∑ ⎜ ⎟
k =1 ⎝ r0 ⎠

Ref: Kashyap R.L. and Ramachandra Rao.A, Dynamic stochastic models from empirical
data , Academic press, New York   22  
Portmanteau test for white noise
• The statistic η(e) is approximately distributed as
χ2α(n1), where α is the significance level at which
the test is being carried out.
• The value of n1 is normally chosen as 0.15N
• If the value of η(e) < χ2α(n1), then the residual
series is uncorrelated.
• Kashyap & Rao(1976) have proved that the
Portmanteau test is uniformly inferior to
Whittle s test and recommended the latter for
applications.

Ref: Kashyap R.L. and Ramachandra Rao.A, Dynamic stochastic models from empirical
data , Academic press, New York   23  
ARIMA Models
Data Generation:
Consider AR(1) model,
Xt = φ1Xt-1 + et

e.g., φ1 = 0.5 : AR(1) model is

Xt = 0.5Xt-1 + et Choose et terms with zero


mean and uncorrelated  

24  
ARIMA Models
Say X1 = 3.0

X2 = 0.5*3.0 + 0.335
= 1.835

X3 = 0.5*1.835 + 1.226
= 2.14

And so on…

25  
ARIMA Models
Consider ARMA(1, 1) model,
Xt = φ1Xt-1 + θ1et-1 + et

e.g., φ1 = 0.5, θ1 = 0.4 : ARMA(1, 1) model is written as

with zero mean and


uncorrelated  
Xt = 0.5Xt-1 + 0.4et-1 + et

Choose et-1 terms as


previous et and set initial
value as zero  
26  
ARIMA Models
Say X1 = 3.0

X2 = 0.5*3.0 + 0.4*0 + 0.667


= 2.167

X3 = 0.5*2.167 + 0.4*0.667 + 1.04


= 2.39

X4 = 0.5*2.39 + 0.4*1.04 + 2.156


= 3.767 and so
on...
27  
ARIMA Models
Data Forecasting:
Consider AR(1) model,
Xt = φ1Xt-1 + et

Expected value is considered.

E [ X t ] = φ1E [ X t −1 ] + E [et ]
Xˆ t = φ1 X t −1
Expected value of et is zero  

28  
ARIMA Models
Consider ARMA(1, 1) model,
Xt = φ1Xt-1 + θ1et-1 + et

E[Xt] = φ1Xt-1 + θ1et-1 + 0


Error in forecast in the
previous period  

e.g., φ1 = 0.5, θ1 = 0.4: Forecast model is written as

Xt = 0.5Xt-1 + 0.4et-1

29  
ARIMA Models
Say X1 = 3.0 Initial error assumed to
be zero  
Xˆ 2 = 0.5 × 3.0 + 0.4 × 0
= 1.5
X2 = 2.8
Error e2 = 2.8 – 1.5 = 1.3

Xˆ 3 = 0.5 × 2.8 + 0.4 ×1.3


= 1.92
Actual value to be used  

30  
ARIMA Models
X3 = 1.8
Error e3 = 1.8 – 1.92 = -0.12

Xˆ 4 = 0.5 ×1.8 + 0.4 × ( −0.12 )


= 0.852

and so on.

31  
Markov Chains
Markov Chains:
• Markov chain is a stochastic process with the
property that value of process Xt at time t depends
on its value at time t-1 and not on the sequence of
other values (Xt-2 , Xt-3,……. X0) that the process
passed through in arriving at Xt-1.

P [ X t X t −1 , X t −2 ,..... X 0 ] = P [ X t X t −1 ]
Single step Markov
chain  

32  
Markov Chains

P ⎡⎣ X t = a j X t −1 = ai ⎤⎦

• The conditional probability gives the probability at


time t will be in state j , given that the process
was in state i at time t-1.
• The conditional probability is independent of the
states occupied prior to t-1.
• For example, if Xt-1 is a dry day, what is the
probability that Xt is a dry day or a wet day.
• This probability is commonly called as transitional
probability
33  
Markov Chains
t
P ⎣ X t = a j X t −1 = ai ⎦ = Pij
⎡ ⎤

• Usually written as Pijt indicating the probability of a


step from ai to aj at time ‘t’.
• If Pij is independent of time, then the Markov chain
is said to be homogeneous.

i.e., Pijt = Pijt +τ v t and τ

the transitional probabilities remain same across


time
34  
Markov Chains
Transition Probability Matrix(TPM):
t+1 1 2 3 . . m
t
1 ⎡ P11 P12 P13 . . P1m ⎤
⎢ P P22 P23 . . P2 m ⎥⎥
2
⎢ 21
3 ⎢ P31 ⎥
P= ⎢ ⎥
. ⎢ . ⎥
. ⎢ . ⎥
⎢ ⎥
m ⎢⎣ Pm1 Pm 2 Pmm ⎥⎦
m x m  
35  
Markov Chains
m

∑P
j =1
ij =1 v j

• Elements in any row of TPM sum to unity


(stochastic matrix)
• TPM can be estimated from observed data by
tabulating the number of times the observed data
went from state i to j
• Pj (n) is the probability of being in state j in the
time step n .

36  
Markov Chains
• pj(0) is the probability of being in state j in period
t = 0.

p(0) = ⎡⎣ p1(0) p2(0) . . pm(0) ⎤⎦ …. Probability


1× m vector at time 0

(n) ( n) (n) ( n ) ⎤
p = ⎣ p1
⎡ p2 . . pm ⎦ …. Probability
1× m vector at time
n
• Let p(0) is given and TPM is given
(1) (0)
p = p ×P

37  
Markov Chains
⎡ P11 P12 P13 . . P1m ⎤
⎢ P P22 P23 . . P2 m ⎥⎥
⎢ 21
p (1) = ⎡⎣ p1(0) p2(0) . . pm(0) ⎤⎦ ⎢ P31 ⎥
⎢ ⎥
⎢ . ⎥
⎢⎣ Pm1 Pm 2 Pmm ⎥⎦

= p1(0) P11 + p2(0) P21 + .... + pm(0) Pm1 …. Probability of


going to state 1

( 0) ( 0) ( 0)
= p1 P12 + p2 P21 + .... + pm Pm2 …. Probability of
going to state 2
And so on…

38  
Markov Chains
Therefore

(1) (1) (1) (1) ⎤


p = ⎣ p1
⎡ p2 . . pm ⎦
1× m

p( 2) = p(1) × P
= p(0) × P × P
(0)
= p × P2
In general,
(n) (0) n
p = p ×P
39  
Markov Chains
• As the process advances in time, pj(n) becomes less
dependent on p(0)
• The probability of being in state j after a large
number of time steps becomes independent of the
initial state of the process.
• The process reaches a steady state ay very large n
n
p = p× P
• As the process reach steady state, TPM remains
constant

40  
Example – 1
Consider the TPM for a 2-state (state 1 is non-rainfall day
and state 2 is rainfall day) first order homogeneous
Markov chain as
⎡0.7 0.3⎤
TPM = ⎢ ⎥
⎣ 0.4 0.6 ⎦
Obtain the
1. probability of day 1 is non-rainfall day / day 0 is
rainfall day
2. probability of day 2 is rainfall day / day 0 is non-
rainfall day
3. probability of day 100 is rainfall day / day 0 is non-
rainfall day
41  
Example – 1 (contd.)
1. probability of day 1 is non-rainfall day / day 0 is
rainfall day
No rain rain
No rain ⎡0.7 0.3⎤
TPM =
rain ⎢ 0.4 0.6⎥⎦
⎣
The probability is 0.4

2. probability of day 2 is rainfall day / day 0 is non-


rainfall day

p( 2) = p (0) × P 2

42  
Example – 1 (contd.)
( 2) ⎡0.7 0.3⎤
p = [0.7 0.3] ⎢ ⎥
⎣ 0.4 0.6 ⎦
= [0.61 0.39]
The probability is 0.39

3. probability of day 100 is rainfall day / day 0 is non-


rainfall day

(n) (0)
p = p × Pn

43  
Example – 1 (contd.)
P2 = P × P
⎡0.7 0.3⎤ ⎡0.7 0.3⎤ ⎡ 0.61 0.39 ⎤
= ⎢ ⎥ ⎢ ⎥ = ⎢ ⎥
⎣ 0.4 0.6 ⎦ ⎣ 0.4 0.6 ⎦ ⎣ 0.52 0.48 ⎦
4 2 2 ⎡0.5749 0.4251⎤
P = P × P = ⎢ ⎥
⎣ 0.5668 0.4332 ⎦
8 4 ⎡ 0.5715
4 0.4285 ⎤
P = P × P = ⎢
⎣0.5714 0.4286 ⎥⎦
16 8 8 ⎡0.5714 0.4286 ⎤
P = P × P = ⎢
⎣0.5714 0.4286 ⎥⎦

44  
Example – 1 (contd.)
Steady state probability
p = [0.5714 0.4286]

For steady state,


p = p × Pn
⎡0.5714 0.4286 ⎤
= [0.5714 0.4286] ⎢ ⎥
⎣ 0.5714 0.4286 ⎦
= [0.5714 0.4286]

45  

You might also like