For a bivariate time series, g13cf calculates the gain and phase together with lower and upper bounds from the univariate and bivariate spectra.
Syntax
C# |
---|
public static void g13cf( double[] xg, double[] yg, double[] xyrg, double[] xyig, int ng, double[] stats, double[] gn, double[] gnlw, double[] gnup, double[] ph, double[] phlw, double[] phup, out int ifail ) |
Visual Basic |
---|
Public Shared Sub g13cf ( _ xg As Double(), _ yg As Double(), _ xyrg As Double(), _ xyig As Double(), _ ng As Integer, _ stats As Double(), _ gn As Double(), _ gnlw As Double(), _ gnup As Double(), _ ph As Double(), _ phlw As Double(), _ phup As Double(), _ <OutAttribute> ByRef ifail As Integer _ ) |
Visual C++ |
---|
public: static void g13cf( array<double>^ xg, array<double>^ yg, array<double>^ xyrg, array<double>^ xyig, int ng, array<double>^ stats, array<double>^ gn, array<double>^ gnlw, array<double>^ gnup, array<double>^ ph, array<double>^ phlw, array<double>^ phup, [OutAttribute] int% ifail ) |
F# |
---|
static member g13cf : xg : float[] * yg : float[] * xyrg : float[] * xyig : float[] * ng : int * stats : float[] * gn : float[] * gnlw : float[] * gnup : float[] * ph : float[] * phlw : float[] * phup : float[] * ifail : int byref -> unit |
Parameters
- xg
- Type: array<System..::..Double>[]()[][]An array of size [ng]On entry: the ng univariate spectral estimates, , for the series.
- yg
- Type: array<System..::..Double>[]()[][]An array of size [ng]On entry: the ng univariate spectral estimates, , for the series.
- xyrg
- Type: array<System..::..Double>[]()[][]An array of size [ng]On entry: the real parts, , of the ng bivariate spectral estimates for the and series. The series leads the series.
- xyig
- Type: array<System..::..Double>[]()[][]An array of size [ng]On entry: the imaginary parts, , of the ng 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.
- ng
- Type: System..::..Int32On entry: the number of spectral estimates in each of the arrays xg, yg, xyrg and xyig. It is also the number of gain and phase estimates.Constraint: .
- stats
- Type: array<System..::..Double>[]()[][]An array of size []On entry: the four associated statistics for the univariate spectral estimates for the and series. contains the degrees of freedom, and contain the lower and upper bound multiplying factors respectively and holds the bandwidth.Constraint: .
- gn
- Type: array<System..::..Double>[]()[][]An array of size [ng]On exit: the ng gain estimates, , at each frequency .
- gnlw
- Type: array<System..::..Double>[]()[][]An array of size [ng]
- gnup
- Type: array<System..::..Double>[]()[][]An array of size [ng]
- ph
- Type: array<System..::..Double>[]()[][]An array of size [ng]On exit: the ng phase estimates, , at each frequency .
- phlw
- Type: array<System..::..Double>[]()[][]An array of size [ng]
- phup
- Type: array<System..::..Double>[]()[][]An array of size [ng]
- ifail
- Type: System..::..Int32%On exit: unless the method detects an error or a warning has been flagged (see [Error Indicators and Warnings]).
Description
Estimates of the gain and phase of the dependency of series on series at frequency are given by
The quantities used in these definitions are obtained as in [Description] in g13ce.
Confidence limits are returned for both gain and phase, but should again be taken as very approximate when the coherency , as calculated by g13ce, is not significant. These are based on the assumption that both and are Normal with variance
Although the estimate of is always given in the range , no attempt is made to restrict its confidence limits to this range.
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
Error Indicators and Warnings
Errors or warnings detected by the method:
On entry, , or .
- A bivariate spectral estimate is zero. For this frequency the gain and the phase and their bounds are set to zero.
- A univariate spectral estimate is negative. For this frequency the gain and the phase and their bounds are set to zero.
- A univariate spectral estimate is zero. For this frequency the gain and the phase and their bounds are set to zero.
- A calculated value of the squared coherency exceeds . For this frequency the squared coherency is reset to in the formulae for the gain and phase bounds.
If more than one failure of types , , and 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.
Accuracy
All computations are very stable and yield good accuracy.
Parallelism and Performance
None.
Further Comments
Example
This example reads the set of univariate spectrum statistics, the two univariate spectra and the cross spectrum at a frequency division of for a pair of time series. It calls g13cf to calculate the gain and the phase and their bounds and prints the results.
Example program (C#): g13cfe.cs