H Y D R O L O G Y P R O JE C T Technical Assistance Correlation and spectral analysis • Objective: – investigation of correlation structure of time series – identification of major harmonic components in time series • Tools: – auto-covariance and auto-correlation function – cross-covariance and cross-correlation function – variance spectrum and spectral density function
22
Embed
Correlation and spectral analysis Objective: –investigation of correlation structure of time series –identification of major harmonic components in time.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
HYDROLOGY PROJECTTechnical Assistance
Correlation and spectral analysis
• Objective:– investigation of correlation structure of time series– identification of major harmonic components in time
series
• Tools:– auto-covariance and auto-correlation function– cross-covariance and cross-correlation function– variance spectrum and spectral density function
HYDROLOGY PROJECTTechnical Assistance
Autocovariance and autocorrelation function
• Autocovariance function of series Y(t):
• Covariance at lag 0 = variance:
• To ensure comparibility scaling of autocovariance by variance:
Estimation of cross-covariance and cross-correlation function
• Estimation of cross-covariance:
• Estimation of cross-correlation:
• Note that estimators are biased since n rather than (n-k-1) is used in divider, but estimator provides smaller mean square error
)my)(mx(n
1)k(C yki
kn
1ixiXY
n
1i
2yi
n
1i
2xi
kn
1iykixi
YYXX
XYXY
)my(n
1)mx(
n
1
)my)(mx(n
1
)0(C)0(C
)k(C)k(r
HYDROLOGY PROJECTTechnical Assistance
Variance spectrum and spectral density function
• Plot of variance of harmonics versus their frequencies is called power or variance spectrum– If Sp(f) is the ordinate of continuous spectrum then the
variance contributed by all frequencies in the frequency interval f, f+df is given by Sp(f).df. Hence:
– Hydrological processes can be considered to be frequency limited, hence harmonics with f > fc do not significantly contribute to variance of the process. Then:
– fc = Nyquist or cut-off frequency
0
2Yp df).f(S
cf
0
2Yp df).f(S
HYDROLOGY PROJECTTechnical Assistance
Spectrum (2)
• Scaling of variance spectrum by variance (to make them comparable) gives the spectral density function:
• spectral density function is Fourier transform of auto-correlation function
1df).f(S:hence)f(S
)f(Scf
0
d2Y
pd
1kYYd )fk2cos()k(212)f(S
HYDROLOGY PROJECTTechnical Assistance
Estimation of spectrum
• Replace YY(k) by rYY(k) for k=0,1,2,…,M
• M = maximum lag for which acf is estimated• M is to be carefully selected• To reduce sampling variance in estimate a smoothing
function is applied: the spectral density at fk is estimated as weighted average of density at fk-1 ,fk ,fk+1
• Smoothing function is spectral window• Spectral window has to be carefully designed • Appropriate window is Tukey window:
• In frequency domain it implies fk is weighted average according to: 1/4fk-1 ,1/2fk ,1/4fk+1
Mk:for0)k(T
Mk:for)M
kcos(1
2
1)k(T
w
w
M3
N8n:and
tM3
4B
Bandwidth
Number of degrees of freedom
HYDROLOGY PROJECTTechnical Assistance
Estimation of spectrum (2)
• Spectral estimator s(f) for Sd(f) becomes:
• To be estimated at:
• According to Jenkins and Watts number of frequency points should be 2 to 3 times (M+1)
• (1-)100% confidence limits:
2
1,....,0f:for)fk2cos()k(r)k(T212)f(s
1M
1kYYw
M,......,1,0k:forM
kff ck
)2
(
)f(s.n)f(S
)2
1(
)f(s.n
2n
d2n
fc = 1/(2t)
HYDROLOGY PROJECTTechnical Assistance
Confidence limits for white noise (s(f) =2)
Variance reduces with decreasing M; for n > 25 variance reduces only slowly
HYDROLOGY PROJECTTechnical Assistance
Estimation of spectrum (3)
• To reduce sampling variance, M should be taken small, say M = 10 to 15 % of N (= series length)
• However, small M leads to large bandwidth B• Large B gives smoothing over large frequency range • E.g. if one expects significant harmonics with periods 16
and 24 hours in hourly series:– frequency difference is 1/16 - 1/24 = 1/48
– hence: B < 1/48
– so: M > 4x48/3 = 64
– by choosing M = 10% of N, then N > 640 data points or about one month
• Since it is not known in advance which harmonics are significant, estimation is to be repeated for different M
• White noise: YY(k) = 0 for k > 0 it follows since 0 f1/2, for white noise s(f) 2
HYDROLOGY PROJECTTechnical Assistance
Example of spectrum of monthly rainfall data for station PATAS
Series =PATAS MPS Date of first element = 1970 1 0 0 1 Date of last element = 1989 12 0 0 1
Truncation lag = 72 Number of frequency points = 72
Bandwith = .0185 Degr.frdom = 8
upper conf. limit white noise = .9125 lower conf. limit white noise = 7.3402
ASPEC = variance spectrum LOG SPEC = logarithm of ASPEC DSPEC = spectral density
HYDROLOGY PROJECTTechnical Assistance
Example of spectrum of monthly rainfall data for station PATAS (2)