Lecture 17
Lecture 17
STOCHASTIC HYDROLOGY
Lecture -17
Course Instructor : Prof. P. P. MUJUMDAR
Department of Civil Engg., IISc.
Summary
of
the
previous
lecture
2
ARIMA Models
Mean square error, MSE (Prediction approach):
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
4
ARIMA Models
The MSE for model is
N
∑ ei2
N
i= +1
2
MSE =
N 2
5
ARIMA Models
3. Model testing / Validation:
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
8
Significance of residual mean
Significance of residual mean:
10
Significance of periodicities
Significance of periodicities:
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 :
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
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):
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):
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
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 [ 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
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
30
ARIMA Models
X3 = 1.8
Error e3 = 1.8 – 1.92 = -0.12
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 ⎤⎦
∑P
j =1
ij =1 v j
36
Markov Chains
• pj(0) is the probability of being in state j in period
t = 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 ⎥⎦
( 0) ( 0) ( 0)
= p1 P12 + p2 P21 + .... + pm Pm2 …. Probability of
going to state 2
And so on…
38
Markov Chains
Therefore
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
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
(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]
45