NAG Library Routine Document

g13bdf  (multi_transf_prelim)

 Contents

    1  Purpose
    7  Accuracy

1
Purpose

g13bdf calculates preliminary estimates of the parameters of a transfer function model.

2
Specification

Fortran Interface
Subroutine g13bdf ( r0, r, nl, nna, s, nwds, wa, iwa, wds, isf, ifail)
Integer, Intent (In):: nl, nna(3), nwds, iwa
Integer, Intent (Inout):: ifail
Integer, Intent (Out):: isf(2)
Real (Kind=nag_wp), Intent (In):: r0, r(nl), s
Real (Kind=nag_wp), Intent (Out):: wa(iwa), wds(nwds)
C Header Interface
#include nagmk26.h
void  g13bdf_ ( const double *r0, const double r[], const Integer *nl, const Integer nna[], const double *s, const Integer *nwds, double wa[], const Integer *iwa, double wds[], Integer isf[], Integer *ifail)

3
Description

g13bdf calculates estimates of parameters δ1,δ2,,δp, ω0,ω1,,ωq in the transfer function model
yt=δ1yt-1+δ2yt-2++δpyt-p+ω0xt-b-ω1xt-b-1--ωqxt-b-q  
given cross-correlations between the series xt and lagged values of yt:
rxyl,  l=0,1,,L  
and the ratio of standard deviations sy/sx, as supplied by g13bcf.
It is assumed that the series xt used to calculate the cross-correlations is a sample from a time series with true autocorrelations of zero. Otherwise the cross-correlations between the series bt and at, as defined in the description of g13baf, should be used in place of those between yt and xt.
The estimates are obtained by solving for δ1,δ2,,δp the equations
rxyb+q+j=δ1rxyb+q+j-1++δprxyb+q+j-p,  j=1,2,,p  
then calculating
ωi = ± sy / sx rxy b+i - δ1 rxy b+i- 1 - - δp rxy b+i-p ,   i= 0,1,,q  
where the ‘+’ is used for ω0 and ‘-’ for ωi, i>0.
Any value of rxyl arising in these equations for l<b is taken as zero. The parameters δ1,δ2,,δp are checked as to whether they satisfy the stability criterion.

4
References

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

5
Arguments

1:     r0 – Real (Kind=nag_wp)Input
On entry: the cross-correlation between the two series at lag 0, rxy0.
Constraint: -1.0r01.0.
2:     rnl – Real (Kind=nag_wp) arrayInput
On entry: the cross-correlations between the two series at lags 1 to L, rxyl, for l=1,2,,L.
Constraint: -1.0ri1.0, for i=1,2,,nl.
3:     nl – IntegerInput
On entry: L, the number of lagged cross-correlations in the array r.
Constraint: nlmaxnna1+nna2+nna3,1.
4:     nna3 – Integer arrayInput
On entry: the transfer function model orders in the standard form b,q,p (i.e., delay time, number of moving-average MA-like followed by number of autoregressive AR-like parameters).
Constraint: nnai0, for i=1,2,3.
5:     s – Real (Kind=nag_wp)Input
On entry: the ratio of the standard deviation of the y series to that of the x series, sy/sx.
Constraint: s>0.0.
6:     nwds – IntegerInput
On entry: the exact number of parameters in the transfer function model.
Constraint: nwds=nna2+nna3+1.
7:     waiwa – Real (Kind=nag_wp) arrayWorkspace
8:     iwa – IntegerInput
On entry: the dimension of the array wa as declared in the (sub)program from which g13bdf is called.
Constraint: iwanna3×nna3+1.
9:     wdsnwds – Real (Kind=nag_wp) arrayOutput
On exit: the preliminary estimates of the parameters of the transfer function model in the order of q+1 MA-like parameters followed by the p AR-like parameters. If the estimation of either type of parameter fails then these arguments are set to 0.0.
10:   isf2 – Integer arrayOutput
On exit: indicators of the success of the estimation of MA-like and AR-like parameters respectively. A value 0 indicates that there are no parameters of that type to be estimated. A value of 1 or -1 indicates that there are parameters of that type in the model and the estimation of that type has been successful or unsuccessful respectively. Note that there is always at least one MA-like parameter in the model.
11:   ifail – IntegerInput/Output
On entry: ifail must be set to 0, -1​ or ​1. If you are unfamiliar with this argument you should refer to Section 3.4 in How to Use the NAG Library and its Documentation for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value -1​ or ​1 is recommended. If the output of error messages is undesirable, then the value 1 is recommended. Otherwise, if you are not familiar with this argument, the recommended value is 0. When the value -1​ or ​1 is used it is essential to test the value of ifail on exit.
On exit: ifail=0 unless the routine detects an error or a warning has been flagged (see Section 6).

6
Error Indicators and Warnings

If on entry ifail=0 or -1, explanatory error messages are output on the current error message unit (as defined by x04aaf).
Errors or warnings detected by the routine:
ifail=1
On entry,nnai<0, for i=1,2,3,
ornl<maxnna1+nna2+nna3,1,
orr0<-1.0 or r0>1.0,
orri<-1.0 or ri>1.0, for some i=1,2,,nl,
ors0.0,
ornwdsnna2+nna3+1,
oriwa<nna3×nna3+1.
ifail=-99
An unexpected error has been triggered by this routine. Please contact NAG.
See Section 3.9 in How to Use the NAG Library and its Documentation for further information.
ifail=-399
Your licence key may have expired or may not have been installed correctly.
See Section 3.8 in How to Use the NAG Library and its Documentation for further information.
ifail=-999
Dynamic memory allocation failed.
See Section 3.7 in How to Use the NAG Library and its Documentation for further information.

7
Accuracy

Equations used in the computations may become unstable, in which case results are reset to zero with array isf values set accordingly.

8
Parallelism and Performance

g13bdf is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
g13bdf makes calls to BLAS and/or LAPACK routines, which may be threaded within the vendor library used by this implementation. Consult the documentation for the vendor library for further information.
Please consult the X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this routine. Please also consult the Users' Note for your implementation for any additional implementation-specific information.

9
Further Comments

If nna3>0,a local workspace array of fixed length is allocated internally by g13bdf. The total size of this array amounts to nna3 integer elements and nna3×nna3+1 real elements.
The time taken by g13bdf is roughly proportional to nwds3.

10
Example

This example reads the cross-correlations between two series at lags 0 to 6. It then reads a 3,2,1 transfer function model and calculates and prints the preliminary estimates of the parameters of the model.

10.1
Program Text

Program Text (g13bdfe.f90)

10.2
Program Data

Program Data (g13bdfe.d)

10.3
Program Results

Program Results (g13bdfe.r)

© The Numerical Algorithms Group Ltd, Oxford, UK. 2017