g13bb filters a time series by a transfer function model.

Syntax

C#
public static void g13bb(
	double[] y,
	int ny,
	int[] mr,
	int nmr,
	double[] par,
	double cy,
	double[] b,
	out int ifail
)
Visual Basic
Public Shared Sub g13bb ( _
	y As Double(), _
	ny As Integer, _
	mr As Integer(), _
	nmr As Integer, _
	par As Double(), _
	cy As Double, _
	b As Double(), _
	<OutAttribute> ByRef ifail As Integer _
)
Visual C++
public:
static void g13bb(
	array<double>^ y, 
	int ny, 
	array<int>^ mr, 
	int nmr, 
	array<double>^ par, 
	double cy, 
	array<double>^ b, 
	[OutAttribute] int% ifail
)
F#
static member g13bb : 
        y : float[] * 
        ny : int * 
        mr : int[] * 
        nmr : int * 
        par : float[] * 
        cy : float * 
        b : float[] * 
        ifail : int byref -> unit 

Parameters

y
Type: array<System..::..Double>[]()[][]
An array of size [ny]
On entry: the Qy backforecasts starting with backforecast at time 1-Qy to backforecast at time 0 followed by the time series starting at time 1, where Qy=mr[5]+mr[8]×mr[9]. If there are no backforecasts either because the ARIMA model for the time series is not known or because it is known but has no moving average terms, then the time series starts at the beginning of y.
ny
Type: System..::..Int32
On entry: the total number of backforecasts and time series data points in array y.
Constraint: nymax1+Qy,_npar.
mr
Type: array<System..::..Int32>[]()[][]
An array of size [nmr]
On entry: the orders vector for the filtering transfer function model followed by the orders vector for the ARIMA model for the time series if the latter is known. The transfer function model orders appear in the standard form b,q,p as given in the G13 class. Note that if the ARIMA model for the time series is supplied then the method will assume that the first Qy values of the array y are backforecasts.
Constraints:
the filtering model is restricted in the following way:
  • mr[0], ​mr[1], ​mr[2]0.
the ARIMA model for the time series is restricted in the following ways:
  • mr[k]0, for k=3,4,,9;
  • if mr[9]=0, mr[6]+mr[7]+mr[8]=0;
  • if mr[9]0, mr[6]+mr[7]+mr[8]0;
  • mr[9]1.
nmr
Type: System..::..Int32
On entry: the number of values supplied in the array mr. It takes the value 3 if no ARIMA model for the time series is supplied but otherwise it takes the value 10. Thus nmr acts as an indicator as to whether backforecasting can be carried out.
Constraint: nmr=3 or 10.
par
Type: array<System..::..Double>[]()[][]
An array of size [dim1]
Note: dim1 must satisfy the constraint:
  • if nmr=3, _npar=_transfv.nag_q+_transfv.nag_p+1;
  • if nmr=10, _npar=_transfv.nag_q+_transfv.nag_p+1+_arimas.p+_arimas.q+_arimas.bigp+_arimas.bigq.
  • if nmr=3, _npar=mr[1]+mr[2]+1;
  • if nmr=10, _npar=mr[1]+mr[2]+1+mr[3]+mr[5]+mr[6]+mr[8].
On entry: the parameters of the filtering transfer function model followed by the parameters of the ARIMA model for the time series. In the transfer function model the parameters are in the standard order of MA-like followed by AR-like operator parameters. In the ARIMA model the parameters are in the standard order of non-seasonal AR and MA followed by seasonal AR and MA.
cy
Type: System..::..Double
On entry: if the ARIMA model is known (i.e., nmr=10), cy must specify the constant term of the ARIMA model for the time series. If this model is not known (i.e., nmr=3) then cy is not used.
b
Type: array<System..::..Double>[]()[][]
An array of size [nb]
On exit: the filtered output series. If the ARIMA model for the time series was known, and hence Qy backforecasts were supplied in y, then b contains Qy ‘filtered’ backforecasts followed by the filtered series. Otherwise, the filtered series begins at the start of b just as the original series began at the start of y. In either case, if the value of the series at time t is held in y[t-1], then the filtered value at time t is held in b[t-1].
ifail
Type: System..::..Int32%
On exit: ifail=0 unless the method detects an error or a warning has been flagged (see [Error Indicators and Warnings]).

Description

From a given series y1,y2,,yn a new series b1,b2,,bn is calculated using a supplied (filtering) transfer function model according to the equation
bt=δ1bt-1+δ2bt-2++δpbt-p+ω0yt-b-ω1yt-b-1--ωqyt-b-q. (1)
As in the use of g13ba, large transient errors may arise in the early values of bt due to ignorance of yt for t<0, and two possibilities are allowed.
(i) The equation (1) is applied from t=1+b+q,,n so all terms in yt on the right-hand side of (1) are known, the unknown set of values bt for t=b+q,,b+q+1-p being taken as zero.
(ii) The unknown values of yt for t0 are estimated by backforecasting exactly as for g13ba.

References

Box G E P and Jenkins G M (1976) Time Series Analysis: Forecasting and Control (Revised Edition) Holden–Day

Error Indicators and Warnings

Errors or warnings detected by the method:
Some error messages may refer to parameters that are dropped from this interface (NPAR) In these cases, an error in another parameter has usually caused an incorrect value to be inferred.
ifail=1
On entry,nmr3 and nmr10,
ormr[i-1]<0, for i=1,2,,nmr,
ornmr=10 and mr[9]=1,
ornmr=10 and mr[9]=0 and mr[6]+mr[7]+mr[8]0,
ornmr=10 and mr[9]0, and mr[6]+mr[7]+mr[8]=0,
orwa is too small,
orb is too small.
ifail=2
A supplied model has parameter values which have failed the validity test.
ifail=3
The supplied time series is too short to carry out the requested filtering successfully.
ifail=4
This only occurs when an ARIMA model for the time series has been supplied. The matrix which is used to solve for the starting values for MA filtering is singular.
ifail=-999
Internal memory allocation failed.
ifail=-9000
An error occured, see message report.
ifail=-8000
Negative dimension for array value
ifail=-6000
Invalid Parameters value

Accuracy

Accuracy and stability are high except when the AR-like parameters are close to the invertibility boundary. All calculations are performed in basic precision except for one inner product type calculation which on machines of low precision is performed in additional precision.

Parallelism and Performance

None.

Further Comments

The time taken by g13bb is roughly proportional to the product of the length of the series and number of parameters in the filtering model with appreciable increase if an ARIMA model is supplied for the time series.

Example

This example reads a time series of length 296. It reads one univariate ARIMA 1,1,0,0,1,1,12 model for the series and the 0,13,12 filtering transfer function model. 12 initial backforecasts are required and these are calculated by a call to g13aj . The backforecasts are inserted at the start of the series and g13bb is called to perform the filtering.

Example program (C#): g13bbe.cs

Example program data: g13bbe.d

Example program results: g13bbe.r

See Also