naginterfaces.library.tsa.multi_noise_bivar¶
- naginterfaces.library.tsa.multi_noise_bivar(xg, yg, xyrg, xyig, stats, l, n)[source]¶
For a bivariate time series,
multi_noise_bivar
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.For full information please refer to the NAG Library document for g13cg
https://www.nag.com/numeric/nl/nagdoc_29.2/flhtml/g13/g13cgf.html
- Parameters
- xgfloat, array-like, shape
The univariate spectral estimates, , for the series.
- ygfloat, array-like, shape
The univariate spectral estimates, , for the series.
- xyrgfloat, array-like, shape
The real parts, , of the bivariate spectral estimates for the and series. The series leads the series.
- xyigfloat, array-like, shape
The imaginary parts, , of the bivariate spectral estimates for the and series. The series leads the series.
Note: the two univariate and the bivariate spectra must each have been calculated using the same method of smoothing.
For rectangular, Bartlett, Tukey or Parzen smoothing windows, the same cut-off point of lag window and the same frequency division of the spectral estimates must be used.
For the trapezium frequency smoothing window, 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.
- statsfloat, array-like, shape
The four associated statistics for the univariate spectral estimates for the and series. contains the degree of freedom, and contain the lower and upper bound multiplying factors respectively and contains the bandwidth.
- lint
, the frequency division of the spectral estimates as . It is also the order of the FFT used to calculate the impulse response function. must relate to the parameter by the relationship.
- nint
The number of points in each of the time series and . should have the same value as in the call of
multi_spectrum_lag()
ormulti_spectrum_daniell()
which calculated the smoothed sample cross spectrum. is used in calculating the impulse response function standard error ().
- Returns
- erfloat, ndarray, shape
The estimates of the noise spectrum, at each frequency.
- erlwfloat
The noise spectrum lower limit multiplying factor.
- erupfloat
The noise spectrum upper limit multiplying factor.
- rffloat, ndarray, shape
The impulse response function. Causal responses are stored in ascending frequency in to and anticipatory responses are stored in descending frequency in to .
- rfsefloat
The impulse response function standard error.
- Raises
- NagValueError
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, and .
Constraint: .
- Warns
- NagAlgorithmicWarning
- (errno )
A bivariate spectral estimate is zero.
For this frequency the noise spectrum is set to zero, and the contribution to the impulse response function and its standard error is set to zero.
- (errno )
A univariate spectral estimate is negative.
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.
- (errno )
A univariate 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.
- (errno )
A calculated value of the squared coherency exceeds .
For this frequency the squared coherency is reset to with the consequence that the noise spectrum is zero and the contribution to the impulse response function at this frequency is zero.
- Notes
In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.
An estimate of the noise spectrum in the dependence of series on series at frequency is given by
where is the squared coherency described in
multi_spectrum_bivar()
and is the univariate spectrum estimate for series . Confidence limits on the true spectrum are obtained using multipliers as described foruni_spectrum_lag()
, but based on degrees of freedom.If the dependence of on can be assumed to be represented in the time domain by the one sided relationship
where the noise is independent of , then it is the spectrum of this noise which is estimated by .
Estimates of the impulse response function may also be obtained as
where indicates the real part of the expression. For this purpose it is essential that the univariate spectrum for , , and the cross spectrum, , be supplied to this function for a frequency range
where denotes the integer part, the integral being approximated by a finite Fourier transform.
An approximate standard error is calculated for the estimates . Significant values of in the locations described as anticipatory responses in the argument array indicate that feedback exists from to . This will bias the estimates of in any causal dependence of on .
- References
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