g13ag accepts a series of new observations of a time series, the model of which is already fully specified, and updates the ‘state set’ information for use in constructing further forecasts. The previous specifications of the time series model should have been obtained by using (G13AEF not in this release) g13af to estimate the relevant parameters. The supplied state set will originally have been produced by (G13AEF not in this release) g13af, but may since have been updated by earlier calls to g13ag.
A set of residuals corresponding to the new observations is returned. These may be of use in checking that the new observations conform to the previously fitted model.


public static void g13ag(
	double[] st,
	int nst,
	int[] mr,
	double[] par,
	double c,
	double[] anx,
	int nuv,
	double[] anexr,
	out int ifail
Visual Basic
Public Shared Sub g13ag ( _
	st As Double(), _
	nst As Integer, _
	mr As Integer(), _
	par As Double(), _
	c As Double, _
	anx As Double(), _
	nuv As Integer, _
	anexr As Double(), _
	<OutAttribute> ByRef ifail As Integer _
Visual C++
static void g13ag(
	array<double>^ st, 
	int nst, 
	array<int>^ mr, 
	array<double>^ par, 
	double c, 
	array<double>^ anx, 
	int nuv, 
	array<double>^ anexr, 
	[OutAttribute] int% ifail
static member g13ag : 
        st : float[] * 
        nst : int * 
        mr : int[] * 
        par : float[] * 
        c : float * 
        anx : float[] * 
        nuv : int * 
        anexr : float[] * 
        ifail : int byref -> unit 


Type: array<System..::..Double>[]()[][]
An array of size [nst]
On entry: the state set derived from (G13AEF not in this release) g13af, or as modified using earlier calls of g13ag.
On exit: the updated values of the state set.
Type: System..::..Int32
On entry: the number of values in the state set array st.
Constraint: nst=P×s+D×s+d+q+maxp,Q×s. (As returned by (G13AEF not in this release) g13af).
Type: array<System..::..Int32>[]()[][]
An array of size [7]
On entry: the orders vector p,d,q,P,D,Q,s of the ARIMA model, in the usual notation.
  • p,d,q,P,D,Q,s0;
  • p+q+P+Q>0;
  • s1;
  • if s=0, P+D+Q=0;
  • if s>1, P+D+Q>0.
Type: array<System..::..Double>[]()[][]
An array of size [dim1]
Note: dim1 must satisfy the constraint: _npar=p+q+P+Q
On entry: the estimates of the p values of the ϕ parameters, the q values of the θ parameters, the P values of the Φ parameters and the Q values of the Θ parameters in the model – in that order, using the usual notation.
Type: System..::..Double
On entry: the constant to be subtracted from the differenced data.
Type: array<System..::..Double>[]()[][]
An array of size [nuv]
On entry: the new undifferenced observations which are to be used to update st.
Type: System..::..Int32
On entry: k, the number of new observations in anx.
Type: array<System..::..Double>[]()[][]
An array of size [nuv]
On exit: the residuals corresponding to the new observations in anx.
Type: System..::..Int32%
On exit: ifail=0 unless the method detects an error or a warning has been flagged (see [Error Indicators and Warnings]).


The time series model is specified as outlined in Section in g13ae or g13af. This also describes how the state set, which contains the minimum amount of time series information needed to construct forecasts, is made up of
(i) the differenced series wt (uncorrected for the constant c), for N-P×s<tN,
(ii) the d values required to reconstitute the original series xt from the differenced series wt,
(iii) the intermediate series et, for N-maxp,Q×s<tN, and
(iv) the residual series at, for N-q<tN.
If the number of original undifferenced observations was n, then d=d+D×s and N=n-d.
To update the state set, given a number of new undifferenced observations xt, t=n+1,n+2,,n+k, the four series above are first reconstituted.
Differencing and residual calculation operations are then applied to the new observations and k new values of wt,et and at are derived.
The first k values in these three series are then discarded and a new state set is obtained.
The residuals in the at series corresponding to the k new observations are preserved in an output array. The parameters of the time series model are not changed in this method.



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.
On entry,the orders vector mr is invalid (check the constraints in [Parameters]).
On entry,nstP×s+D×s+d+q+maxQ×s,p.
On entry,nuv0.
An error occured, see message report.
Negative dimension for array value
Invalid Parameters value


The computations are believed to be stable.

Parallelism and Performance


Further Comments

The time taken by g13ag is approximately proportional to nuv×_npar.


Twelve new observations are supplied. The method updates the state set and outputs a set of residuals corresponding to the new observations.

Example program (C#): g13age.cs

Example program data: g13age.d

Example program results: g13age.r

See Also