naginterfaces.library.tsa.multi_​spectrum_​daniell

naginterfaces.library.tsa.multi_spectrum_daniell(nxy, mtxy, pxy, mw, ish, pw, l, xg, yg)[source]

multi_spectrum_daniell calculates the smoothed sample cross spectrum of a bivariate time series using spectral smoothing by the trapezium frequency (Daniell) window.

For full information please refer to the NAG Library document for g13cd

https://support.nag.com/numeric/nl/nagdoc_30.2/flhtml/g13/g13cdf.html

Parameters
nxyint

, the length of the time series and .

mtxyint

Whether the data is to be initially mean or trend corrected.

For no correction.

For mean correction.

For trend correction.

pxyfloat

The proportion of the data (totalled over both ends) to be initially tapered by the split cosine bell taper.

A value of implies no tapering.

mwint

, the frequency width of the smoothing window as .

A value of implies that no smoothing is to be carried out.

ishint

, the alignment shift between the and series. If leads , the shift is positive.

pwfloat

, the shape parameter of the trapezium frequency window.

A value of gives a triangular window, and a value of a rectangular window.

If (i.e., no smoothing is carried out) then is not used.

lint

, the frequency division of smoothed cross spectral estimates as .

xgfloat, array-like, shape

The data points of the series.

ygfloat, array-like, shape

The data points of the series.

Returns
xgfloat, ndarray, shape

The real parts of the cross spectral estimates in elements to , and to contain . The series leads the series.

ygfloat, ndarray, shape

The imaginary parts of the cross spectral estimates in elements to , and to contain . The series leads the series.

ngint

The number of spectral estimates, , whose separate parts are held in and .

Raises
NagValueError
(errno )

On entry, and .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

On entry, , and .

Constraint: if , .

(errno )

On entry, , and .

Constraint: if , .

(errno )

On entry, and .

Constraint: .

(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: must be a multiple of .

(errno )

On entry, and .

Constraint: .

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.

The supplied time series may be mean and trend corrected and tapered as in the description of uni_spectrum_daniell() before calculation of the unsmoothed sample cross-spectrum

for frequency values , .

A correction is made for bias due to any tapering.

As in the description of uni_spectrum_daniell() for univariate frequency window smoothing, the smoothed spectrum is returned as a subset of these frequencies,

where [ ] denotes the integer part.

Its real part or co-spectrum , and imaginary part or quadrature spectrum are defined by

where the weights are similar to the weights defined for uni_spectrum_daniell(), but allow for an implicit alignment shift between the series:

It is recommended that is chosen as the lag at which the cross-covariances peak, so as to minimize bias.

If no smoothing is required, the integer , which determines the frequency window width , should be set to .

The bandwidth of the estimates will normally have been calculated in a previous call of uni_spectrum_daniell() for estimating the univariate spectra of and .

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