0% found this document useful (0 votes)
24 views47 pages

Lecture 13

This document discusses frequency domain analysis, which analyzes time series data in the frequency domain rather than the time domain. It explains that spectral analysis can help identify significant periodicities in data that are difficult to see with time domain analysis alone. The key steps are: 1) Plot the time series, 2) Plot the correlogram to see autocorrelations, 3) Plot the spectrum to identify dominant frequencies and periodic components in the data. Periodicities seen as spikes in the spectrum can then be tested for significance by removing them from the original data.

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)
24 views47 pages

Lecture 13

This document discusses frequency domain analysis, which analyzes time series data in the frequency domain rather than the time domain. It explains that spectral analysis can help identify significant periodicities in data that are difficult to see with time domain analysis alone. The key steps are: 1) Plot the time series, 2) Plot the correlogram to see autocorrelations, 3) Plot the spectrum to identify dominant frequencies and periodic components in the data. Periodicities seen as spikes in the spectrum can then be tested for significance by removing them from the original data.

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/ 47

INDIAN

 INSTITUTE  OF  SCIENCE  

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

• Data Generation – Serially Correlated Data


– First order Markov Model
• Annual flow generation
– First order Markov model with non-stationarity
• Thoma Fiering model for monthly and
seasonal flow generation

2  
FREQUENCY DOMAIN
ANALYSIS

3  
Frequency Domain Analysis
• Auto correlation function or correlogram is used
for analyzing the time series in the time domain.
• Time domain analysis rk  

Xt = dt + εt

xt  
k        
Correlogram

t    
Periodic process with noise

4  
Frequency Domain Analysis
• Periodicities in data can best be determined by
analyzing the time series in frequency domain.

• Spectral analysis or the frequency domain


analysis: the time series is represented in the
frequency domain instead of the time domain

• The observed time series is a random sample of a


process over time and is made up of oscillations
of all possible frequencies.

5  
Frequency Domain Analysis
• Spectral analysis is widely used in electrical
engineering, physics, meteorology and hydrology
• Hydrologic applications of spectral analysis
include:
– Dry and wet run analysis
– Synthetic data generation
– Hydrologic forecasting
– Climate change impact studies

6  
Frequency Domain Analysis
N odd N even
N −1 N
,
2 2
X t = α0 + ∑ ⎡⎣α k cos ( 2π f k t ) + β k sin ( 2π f k t )⎤⎦ + ε t
k =1
t = 1, 2, …. N
k
fk = ;
N
kth harmonic of the fundamental frequency (1/N)

N is the no. of observations


1
Periodicity (P): P=
fk
7  
Frequency Domain Analysis
α0 = x
N
2
αk =
N
∑ x cos ( 2π f t )
t =1
t k k = 1, 2, …. M

N
2
βk =
N
∑ x sin ( 2π f t )
t =1
t k k = 1, 2, …. M

M is maximum lag ( typically considered up to


0.25N)

The above equations for αk and βk are valid up to


k=N/2
8  
Frequency Domain Analysis

When N is odd, the expressions are true until


N
k = −1
2

n
1 t
α N /2 =
N
∑ ( −1) xt
t =1

β N /2 =0

9  
Frequency Domain Analysis
• A variance spectrum divides the variance into no.
of intervals or bands of frequency.
• Spectral density (Ik) is the amount of variance per
interval of frequency.

N 2
I ( k ) = ⎡⎣α k + β k2 ⎤⎦ k = 1, 2, …. M
2
• Angular frequency

2π k
ωk = k = 1, 2, …. M
N

10  
Frequency Domain Analysis

ωk =
P
A plot of ωk vs I(k) is called spectrum
• Total area under the spectrum is
I(k)   equal to the variance of the
process
• A peak in the spectrum indicates
an important contribution to
variance at frequencies close to
ωk       the peak
• Prominent spikes indicate
periodicity
• Several expressions for spectrum
exist in literature
11  
Example-1
Obtain ωk and I(k) for k=1
t Xt cos ( 2π f k t ) sin ( 2π f k t ) X t cos ( 2π f k t ) X t sin ( 2π f k t )
1 105 0.809 0.5878 84.945 61.719
2 115 0.309 0.9511 35.535 109.3765
3 103 -0.309 0.9511 -31.827 97.9633
4 94 -0.809 0.5878 -76.046 55.2532
5 95 -1 0 -95 0
6 104 -0.809 -0.5878 -84.136 -61.1312
7 120 -0.309 -0.9511 -37.08 -114.132
8 121 0.309 -0.9511 37.389 -115.083
9 127 0.809 -0.5878 102.743 -74.6506
10 79 1 0 79 0
Σ 15.523 -40.6849
12  
Example-1 (contd.)
k
fk =
N
1
= = 0.1
10

2 N 2 N
α k = ∑ xt cos ( 2π f k t ) β k = ∑ xt sin ( 2π f k t )
N t =1 N t =1
2 2
= × (15.523) = × ( −40.6849 )
10 10
= 3.1046 = −8.13698

13  
Example-1 (contd.)
N 2
I (k ) = ⎡⎣α k + β k2 ⎤⎦
2
10 ⎡ 2 2
= ( 3.1046 ) + ( −8.13698) ⎤
2 ⎣ ⎦
= 379.245
2π k
ωk =
N
2 × π ×1
=
10
= 0.62832

14  
Frequency Domain Analysis
• Spectral density as defined earlier is also called as
line spectrum

• The line spectrum transforms the information from


time domain to the frequency domain

• While the correlogram indicate the presence of


periodicities in the data, the spectral analysis helps
indentify the significant periodicities themselves

15  
Frequency Domain Analysis
• Line spectrum as defined is an inconsistent estimate

• The plot is not a smooth function

I(k)
0   0.5   1   1.5   2   2.5  

I(k)   ω(k)
• The smoothened spectrum
is called as power
spectrum
ωk      
• Power spectrum is a consistent estimate of spectral
density
16  
Frequency Domain Analysis
• Power spectrum – Fourier cosine transform of auto
covariance function.
N −1
⎡ 2
⎤
I ( k ) = 2 ⎢c0 + 2 ∑ λ j c j cos ( 2π f k j )⎥
⎢ j =1
⎥
⎢⎣ ⎥⎦

cj = Auto covariance function


λj = lag window (or smoothing window)

17  
Frequency Domain Analysis

Tukey window
1 ⎡ ⎛ 2π ⎞ ⎤
λ j = ⎢1 + 2 cos ⎜ ' ⎟ ⎥
2 ⎣ ⎝ M ⎠ ⎦

M = Maximum lag ( ∼ 0.25N)

I(k)   Smoothen diagram

ωk      
18  
Frequency Domain Analysis
• Information content is extracted from spectrum.
• For a completely random series (e.g., uniformly
distributed random numbers), the spectral density
function is constant – termed as white noise
• White noise indicates that no frequency interval
contains any more variance than any other
frequency interval. (auto correlation function
ρk = 0, for k ≠ 0)
I(k)  

ωk      
19  
Frequency Domain Analysis
The steps for analyzing the data are as follows
xt  
• Plot the time series
t    
ρk  

• Plot the correlogram


k    
I(k)  
• Plot the spectrum

ωk      
20  
Frequency Domain Analysis
• The spectrum shows prominent spikes (which
represent the periodicities inherent in the data)
• The period corresponding to any value of ωk may
be computed by 2π/ ωk.

• To test the significance of a periodicity, the


periodicities which are earlier tested to be
significant, are removed from the original series to
get a new series {Zt}, where
Z t = Xt – Y t ,

21  
Frequency Domain Analysis
Yt = µ + αˆ1 cos (ω1t ) + βˆ1 sin (ω1t ) + αˆ 2 cos (ω2t ) + βˆ2 sin (ω2t ) +
........... + αˆ d cos (ωd t ) + βˆd sin (ωd t )

where d is no. of periodicities removed (which are


known to be significant )

• The spectrum of new series Zt is plotted and the


spikes are observed.
• A wrong conclusion may be made that these
spikes are significant. However they need to be
analyzed for their statistical significance
22  
Frequency Domain Analysis
Statistical significance of the periodicities:
The periodicities are tested for significance by
defining a statistic ∩ as follows (Kashyap and
Rao 1976)
γ 2 ( N − 2)
I = 4 ρˆ
1

Where γ2= α2 + β2 and


1 ⎡ N ˆ ⎤
ˆ
N ⎣ t =1
ˆ {
ρ1 = ⎢∑ xt − α cos (ωk t ) − β sin (ωk t ) ⎥
⎦
}
Ref: Kashyap R L and Ramachandra Rao A Dynamic stochastic models from empirical data ,
Academic press, New York, 1976   23  
Frequency Domain Analysis
The periodicity corresponding to ωk is significant at
level α only if

I ≥ F ( 2, N − 2 )

Where F denotes F distribution

•This test examines one periodicity at a time and


should be carried out on a series from which all
periodicities (previously found significant) are
removed.

24  
Frequency Domain Analysis
• A necessary condition in stochastic models is that
the series being modeled must be free from any
significant periodicities.
• One way of removing the periodicities from the
time series is to simply transform the series into a
standardized one.
• One method of standardizing the series {Xt} is by
expressing {Xt} as the new series {Zt} where,

Zt =
( X t − Xi )
Si

25  
Frequency Domain Analysis
• In a monthly series, for example, Xi is the estimate
of mean of month i to which period t belongs
• Si is the estimate of the standard deviation of
month i
• The series has zero mean and unit variance.

• The series without periodicities is then obtained for


which a stochastic (e.g., ARMA – Auto Regressive
Moving Average) model is created.

26  
Example – 2
Monthly Stream flow (in cumec) statistics(1979-2008) for a
river is selected for the study. (Part data shown below)
Year Month S.No. Flow
1979 June 1 54.6
July 2 325.4
August 3 509.5
September 4 99.4
October 5 53.5
November 6 25.8
December 7 12.5
1980 January 8 5.6
February 9 3.1
March 10 2.2
April 11 0.9
May 12 0.81

27  
Example – 2 (contd.)
The time series plot
900  

800  

700  
Flow in Cumec

600  

500  

400  

300  

200  

100  

0  
0   50   100   150   200   250   300   350   400  

Time

28  
Example – 2 (contd.)
• Correlogram
1.2  

1  

0.8  

0.6  

0.4  
ρk
0.2  

0  
0   20   40   60   80   100   120   140  
-­‐0.2  

-­‐0.4  

-­‐0.6  
Lag (k)

29  
Example – 2 (contd.)
• Line Spectrum
6000000  

5000000  

4000000  

3000000  
I(k)

2000000  

1000000  

0  
0   0.5   1   1.5   2   2.5  

-­‐1000000  
ω(k)

30  
Example – 2 (contd.)
• Power Spectrum
2000000  

1800000  

1600000  

1400000  

1200000  

1000000  
I(k)

800000  

600000  

400000  

200000  

0  
0   0.5   1   1.5   2   2.5  
-­‐200000  
W(k)

31  
Example – 2 (contd.)
• Peaks represent the periodicities inherent in the
data.
P=2π/ ωk  
• The peaks correspond to w(k) = 0.5236 indicating
a periodicity of 12 months,
• w(k) = 1.0472 : periodicity of 6 months,
• w(k) = 1.571 : periodicity of 4 months,
• w(k) = 2.094 : periodicity of 3 months

32  
Example – 2 (contd.)
• Considering the first two periodicities are significant,
the two periodicities are removed from the original
series to get a new series {Zt}, where
Z t = Xt – Y t ,

Yt = µ + αˆ1 cos (ω1t ) + βˆ1 sin (ω1t ) + αˆ 2 cos (ω2t ) + βˆ2 sin (ω2t )

Mean of the series µXt = 105.78

ω1= 0.5236 and corresponding α1 = 29.28, β1 = 172.93


ω2= 1.0472 and corresponding α2 = -102.6, β2 = 56.79

33  
Example – 2 (contd.)
For t=1,
Y1 = 105.78 + 29.28cos ( 0.5236 ×1) + 172.93sin ( 0.5236 ×1)
+ ( −102.6 ) cos (1.0472 ×1) + 56.79sin (1.0472 ×1)
= 215.5

Z1 = X1 – Y1
= 54.6 – 215.5
= -160.9

And so on….

34  
Example – 2 (contd.)
Time series plot of Zt,
500  

400  

300  
Flow in Cumec

200  

100  

0  
0   50   100   150   200   250   300   350   400  

-­‐100  

-­‐200  

-­‐300  
Time

35  
Example – 2 (contd.)
Correlogram of Zt,
1.2  

1  

0.8  

0.6  

0.4  
ρk
0.2  

0  
0   20   40   60   80   100   120   140  
-­‐0.2  

-­‐0.4  

-­‐0.6  
Lag, k

36  
Example – 2 (contd.) Power Spectrum
of original series  

Power Spectrum of Zt,

I(k)
350000  

300000  
0   0.5   1   1.5   2   2.5  

250000   W(k)
200000  
I(k)

150000  

100000  

50000  

0  
0   0.5   1   1.5   2   2.5  

-­‐50000  
ω(k)

37  
Example – 2 (contd.)
• Significance test:
γ 2 ( N − 2)
I = 4 ρˆ
1

Where γ2= α2 + β2 and


1 ⎡ N ˆ ⎤
ˆ
N ⎣ t =1
{ ˆ }
ρ1 = ⎢∑ xt − α cos (ωk t ) − β sin (ωk t ) ⎥
⎦
For first peak, ω1= 0.5236, α1 = 29.28, β1 = 172.93

Therefore γ2 = 29.282 + 172.932


= 30762

38  
Example – 2 (contd.)
1 ⎡ N ⎤
ρˆ1 = ⎢ ∑ {xt − α1 cos (ω1t ) − β1 sin (ω1t )}⎥
N ⎣ t =1 ⎦
1
= × 36810.56
348
= 105.78

γ 2 ( N − 2 ) 30762 (348 − 2 )
I =
4 ρˆ1
=
4 ×105.78
= 25155

From F distribution table at 95% significance level,


F(2, 346) = 3.0

39  
Example – 2 (contd.)
I > F ( 2,346 )

Therefore the periodicity is significant.


The values for other periodicities are as follows
ωk Statistic F(2, N-2)
0.5236 25154 3.0
1.0472 11242 3.0
1.5708 4104 3.0
2.0944 1295 3.0

40  
Example – 2 (contd.)
• The periodicities from the time series is removed
by transforming the series into a standardized one.
• The series {Xt} is expressed as the new series {Zt}
where, Month Mean Stdev.
Jun 117.49 52.24

Zt =
( X t − Xi ) Jul
Aug
474.50
421.39
150.18
126.53
Si Sep 145.94 77.65
Oct 66.61 30.67
Nov 22.99 13.26
The mean and standard Dec 10.30 9.82
deviation for each month Jan 5.55 9.16
is tabulated. Feb 1.91 0.74
Mar 1.09 0.54
Apr 0.76 0.51
May 0.80 0.60
41  
Example – 2 (contd.)
For the first value (June month),
( 54.6 − 117.49 )
Z1 = = −1.204
52.24
Second value (July month)
( 325.4 − 474.5)
Z2 = = −0.993
150.18
Third value (August month)
( 509.5 − 421.39 )
Z3 = = 0.696
126.53
And so on….

42  
Example – 2 (contd.)
• Series of Zt (part data shown)
Year Month S.No. Xt Zt
1979 June 1 54.6 -1.204
July 2 325.4 -0.993
August 3 509.5 0.696
September 4 99.4 -0.599
October 5 53.5 -0.428
November 6 25.8 0.212
December 7 12.5 0.224
1980 January 8 5.6 0.006
February 9 3.1 1.609
March 10 2.2 2.063
April 11 0.9 0.272
May 12 0.81 0.019
43  
Example – 2 (contd.)
Time series of standardized data.
7.000  

6.000  

5.000  

4.000  

3.000  
Flow

2.000  

1.000  

0.000  
0   50   100   150   200   250   300   350   400  
-­‐1.000  

-­‐2.000  

-­‐3.000  

-­‐4.000  
Time

44  
Example – 2 (contd.)
Correlogram of standardized data.
1.2  

1  

0.8  

0.6  

ρk 0.4  

0.2  

0  
0   10   20   30   40   50   60   70   80   90   100  

-­‐0.2  

-­‐0.4  
Lag, k

45  
Example – 2 (contd.)
Spectrum of standardized data.
30  

25  

20  

15  
I(k)

10  

5  

0  
0   0.2   0.4   0.6   0.8   1   1.2   1.4   1.6   1.8  

-­‐5  
ω(k)

46  
Example – 2 (contd.)
Test for significance for standardized data:

ωk Statistic F(2, N-2)


0.5236 -4.7E-12 3.0
1.0472 -3.2E-12 3.0
1.5708 -3.5E-11 3.0

I < F ( 2,346 )

The periodicities are insignificant and the time series


is purely stochastic.
47  

You might also like