For a bivariate time series, G13CFF calculates the gain and phase together with lower and upper bounds from the univariate and bivariate spectra.
SUBROUTINE G13CFF ( |
XG, YG, XYRG, XYIG, NG, STATS, GN, GNLW, GNUP, PH, PHLW, PHUP, IFAIL) |
INTEGER |
NG, IFAIL |
REAL (KIND=nag_wp) |
XG(NG), YG(NG), XYRG(NG), XYIG(NG), STATS(4), GN(NG), GNLW(NG), GNUP(NG), PH(NG), PHLW(NG), PHUP(NG) |
|
Estimates of the gain
Gω and phase
ϕω of the dependency of series
y on series
x at frequency
ω are given by
The quantities used in these definitions are obtained as in
Section 3 in G13CEF.
Confidence limits are returned for both gain and phase, but should again be taken as very approximate when the coherency
Wω, as calculated by
G13CEF, is not significant. These are based on the assumption that both
G^ω/Gω-1 and
ϕ^ω are Normal with variance
Although the estimate of
ϕω is always given in the range
0,2π, no attempt is made to restrict its confidence limits to this range.
Jenkins G M and Watts D G (1968)
Spectral Analysis and its Applications Holden–Day
If on entry
IFAIL=0 or
-1, explanatory error messages are output on the current error message unit (as defined by
X04AAF).
If more than one failure of types
2,
3,
4 and
5 occurs then the failure type which occurred at lowest frequency is returned in
IFAIL. However the actions indicated above are also carried out for failures at higher frequencies.
All computations are very stable and yield good accuracy.
The time taken by G13CFF is approximately proportional to
NG.
This example reads the set of univariate spectrum statistics, the two univariate spectra and the cross spectrum at a frequency division of
2π20
for a pair of time series. It calls G13CFF to calculate the gain and the phase and their bounds and prints the results.