For a bivariate time series, g13cgc calculates the noise spectrum together with multiplying factors for the bounds and the impulse response function and its standard error, from the univariate and bivariate spectra.
where $W\left(\omega \right)$ is the squared coherency described in G13GEF and ${f}_{yy}\left(\omega \right)$ is the univariate spectrum estimate for series $y$. Confidence limits on the true spectrum are obtained using multipliers as described for G13CAF, but based on $(d-2)$ degrees of freedom.
If the dependence of ${y}_{t}$ on ${x}_{t}$ can be assumed to be represented in the time domain by the one sided relationship
where the noise ${n}_{t}$ is independent of ${x}_{t}$, then it is the spectrum of this noise which is estimated by ${f}_{y\mid x}\left(\omega \right)$.
Estimates of the impulse response function ${v}_{0},{v}_{1},{v}_{2},\dots $ may also be obtained as
where Re indicates the real part of the expression. For this purpose it is essential that the univariate spectrum for $x$, ${f}_{xx}\left(\omega \right)$,and the cross spectrum, ${f}_{xy}\left(\omega \right)$ be supplied to this function for a frequency range
where $\left[\right]$ denotes the integer part, the integral being approximated by a finite Fourier transform.
An approximate standard error is calculated for the estimates ${v}_{k}$. Significant values of ${v}_{k}$ in the locations described as anticipatory responses in the argument array rf, indicate that feedback exists from ${y}_{t}$ to ${x}_{t}$. This will bias the estimates of ${v}_{k}$ in any causal dependence of ${y}_{t}$ on ${x}_{t},{x}_{t-1},\dots $.
4References
Bloomfield P (1976) Fourier Analysis of Time Series: An Introduction Wiley
Jenkins G M and Watts D G (1968) Spectral Analysis and its Applications Holden–Day
On entry: ${f}_{xy}\left(\omega \right)$, of the ng bivariate spectral estimates for the $x$ and $y$ series. The $x$ series leads the $y$ series.
Note: the two univariate and bivariate spectra must each have been calculated using the same amount of smoothing. The frequency width and the shape of the window and the frequency division of the spectral estimates must be the same. The spectral estimates and statistics must also be unlogged.
4: $\mathbf{ng}$ – IntegerInput
On entry: the number of spectral estimates in each of the arrays xg, yg and xyg. It is also the number of noise spectral estimates.
On entry: the 4 associated statistics for the univariate spectral estimates for the $x$ and $y$ series. ${\mathbf{stats}}\left[0\right]$ contains the degree of freedom, ${\mathbf{stats}}\left[1\right]$ and ${\mathbf{stats}}\left[2\right]$ contain the lower and upper bound multiplying factors respectively and ${\mathbf{stats}}\left[3\right]$ contains the bandwidth.
Constraints:
${\mathbf{stats}}\left[0\right]\ge 3.0$;
$0.0<{\mathbf{stats}}\left[1\right]\le 1.0$;
${\mathbf{stats}}\left[2\right]\ge 1.0$.
6: $\mathbf{l}$ – IntegerInput
On entry: the frequency division, $L$, of the spectral estimates as $2\pi /L$, as input to g13cbc and g13cdc.
Constraints:
${\mathbf{ng}}=[{\mathbf{l}}/2]+1$;
The largest prime factor of l must not exceed $19$, and the total number of prime factors of l, counting repetitions, must not exceed $20$. These two restrictions are imposed by the internal FFT algorithm used.
7: $\mathbf{n}$ – IntegerInput
On entry: the number of points in each of the time series $x$ and $y$. n should have the same value as nxy in the call of g13cccorg13cdc which calculated the smoothed sample cross spectrum. n is used in calculating the impulse response function standard error (rfse).
On exit: the impulse response function. Causal responses are stored in ascending frequency in ${\mathbf{rf}}\left[0\right]$ to ${\mathbf{rf}}\left[{\mathbf{ng}}-1\right]$ and anticipatory responses are stored in descending frequency in ${\mathbf{rf}}\left[{\mathbf{ng}}\right]$ to ${\mathbf{rf}}\left[{\mathbf{l}}\right]$.
12: $\mathbf{rfse}$ – double *Output
On exit: the impulse response function standard error.
13: $\mathbf{fail}$ – NagError *Input/Output
The NAG error argument (see Section 7 in the Introduction to the NAG Library CL Interface).
6Error Indicators and Warnings
NE_2_INT_ARG_CONS
On entry, ${\mathbf{l}}=\u27e8\mathit{\text{value}}\u27e9$ while ${\mathbf{ng}}=\u27e8\mathit{\text{value}}\u27e9$. These arguments must satisfy ${\mathbf{ng}}=[{\mathbf{l}}/2]+1$ when ${\mathbf{ng}}>0$.
NE_ALLOC_FAIL
Dynamic memory allocation failed.
NE_BIVAR_SPECTRAL_ESTIM_ZERO
A bivariate spectral estimate is zero.
For this frequency the noise spectrum is set to zero, and the contributions to the impulse response function and its standard error are set to zero.
NE_FACTOR_GT
At least one of the prime factors of l is greater than $19$.
NE_INT_ARG_LT
On entry, ${\mathbf{n}}=\u27e8\mathit{\text{value}}\u27e9$.
Constraint: ${\mathbf{n}}\ge 1$.
On entry, ${\mathbf{ng}}=\u27e8\mathit{\text{value}}\u27e9$.
Constraint: ${\mathbf{ng}}\ge 1$.
NE_INTERNAL_ERROR
An internal error has occurred in this function. Check the function call
and any array sizes. If the call is correct then please contact NAG for
assistance.
NE_REAL_ARG_GT
On entry, ${\mathbf{stats}}\left[1\right]$ must not be greater than 1.0: ${\mathbf{stats}}\left[1\right]=\u27e8\mathit{\text{value}}\u27e9$.
NE_REAL_ARG_LE
On entry, ${\mathbf{stats}}\left[1\right]$ must not be less than or equal to 0.0: ${\mathbf{stats}}\left[1\right]=\u27e8\mathit{\text{value}}\u27e9$.
NE_REAL_ARG_LT
On entry, ${\mathbf{stats}}\left[0\right]$ must not be less than 3.0: ${\mathbf{stats}}\left[0\right]=\u27e8\mathit{\text{value}}\u27e9$.
On entry, ${\mathbf{stats}}\left[2\right]$ must not be less than 1.0: ${\mathbf{stats}}\left[2\right]=\u27e8\mathit{\text{value}}\u27e9$.
NE_SQUARED_FREQ_GT_ONE
A calculated value of the squared coherency exceeds one.
For this frequency the squared coherency is reset to one with the result that the noise spectrum is zero and the contribution to the impulse response function at this frequency is zero.
For this frequency the noise spectrum is set to zero, and the contributions to the impulse response function and its standard error are set to zero.
NE_UNIVAR_SPECTRAL_ESTIM_ZERO
A bivariate spectral estimate is zero.
For this frequency the noise spectrum is set to zero, and the contributions to the impulse response function and its standard error are set to zero.
7Accuracy
The computation of the noise is stable and yields good accuracy. The FFT is a numerically stable process, and any errors introduced during the computation will normally be insignificant compared with uncertainty in the data.
8Parallelism and Performance
Background information to multithreading can be found in the Multithreading documentation.
g13cgc is not threaded in any implementation.
9Further Comments
The time taken by g13cgc is approximately proportional to ng.
10Example
The example program reads the set of univariate spectrum statistics, the 2 univariate spectra and the cross spectrum at a frequency division of $\frac{2\pi}{20}$ for a pair of time series. It calls g13cgc to calculate the noise spectrum and its confidence limits multiplying factors, the impulse response function and its standard error. It then prints the results.