NAG Library Function Document
nag_tsa_transf_prelim_fit (g13bdc)
1 Purpose
nag_tsa_transf_prelim_fit (g13bdc) calculates preliminary estimates of the parameters of a transfer function model.
2 Specification
#include <nag.h> |
#include <nagg13.h> |
void |
nag_tsa_transf_prelim_fit (double r0,
const double r[],
Integer nl,
Nag_TransfOrder *transfv,
double s,
double wds[],
Integer isf[],
NagError *fail) |
|
3 Description
nag_tsa_transf_prelim_fit (g13bdc) calculates estimates of parameters
,
in the transfer function model
given cross-correlations between the series
and lagged values of
:
and the ratio of standard deviations
, as supplied by
nag_tsa_cross_corr (g13bcc).
It is assumed that the series
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
and
, as defined in the description of
nag_tsa_arma_filter (g13bac), should be used in place of those between
and
.
The estimates are obtained by solving for
the equations
then calculating
where the ‘
’ is used for
and ‘
’ for
,
.
Any value of arising in these equations for is taken as zero. The parameters 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:
– doubleInput
-
On entry: the cross-correlation between the two series at lag , .
Constraint:
.
- 2:
– const doubleInput
-
On entry: the cross-correlations between the two series at lags to ,
, for .
Constraint:
, for .
- 3:
– IntegerInput
-
On entry:
, the number of lagged cross-correlations in the array
r.
Constraint:
.
- 4:
– Nag_TransfOrder *Input
-
On entry: the orders of the transfer function model where the triplet (
transfv. nag_b,
transfv. nag_q,
transfv. nag_p) corresponds to the triplet
as described in
Section 2.3.1 in the g13 Chapter Introduction.
Constraints:
- ;
- ;
- .
- 5:
– doubleInput
-
On entry: the ratio of the standard deviation of the series to that of the series, .
Constraint:
.
- 6:
– doubleOutput
-
Note: the dimension,
dim, of the array
wds
must be at least
.
On exit: the preliminary estimates of the parameters of the transfer function model in the order of MA-like parameters followed by the AR-like parameters. If the estimation of either type of parameter fails then these arguments are set to .
- 7:
– IntegerOutput
-
On exit: indicators of the success of the estimation of MA-like and AR-like parameters respectively. A value indicates that there are no parameters of that type to be estimated. A value of or 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.
- 8:
– NagError *Input/Output
-
The NAG error argument (see
Section 3.6 in the Essential Introduction).
6 Error Indicators and Warnings
- NE_ALLOC_FAIL
-
Dynamic memory allocation failed.
See
Section 3.2.1.2 in the Essential Introduction for further information.
- NE_BAD_PARAM
-
On entry, argument had an illegal value.
- NE_CONSTRAINT
-
On entry, .
Constraint: .
On entry, .
Constraint: .
On entry, .
Constraint: .
- NE_INT_4
-
On entry, , , and .
Constraint: .
- NE_INTERNAL_ERROR
-
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact
NAG for assistance.
An unexpected error has been triggered by this function. Please contact
NAG.
See
Section 3.6.6 in the Essential Introduction for further information.
- NE_NO_LICENCE
-
Your licence key may have expired or may not have been installed correctly.
See
Section 3.6.5 in the Essential Introduction for further information.
- NE_REAL
-
On entry,
r0 lies outside
:
.
On entry, .
Constraint: .
- NE_REAL_ARRAY_ELEM_CONS
-
On entry, lies outside : and .
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
nag_tsa_transf_prelim_fit (g13bdc) is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
nag_tsa_transf_prelim_fit (g13bdc) 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 function. Please also consult the
Users' Note for your implementation for any additional implementation-specific information.
The time taken by nag_tsa_transf_prelim_fit (g13bdc) is roughly proportional to .
10 Example
This example reads the cross-correlations between two series at lags to . It then reads a transfer function model and calculates and prints the preliminary estimates of the parameters of the model.
10.1 Program Text
Program Text (g13bdce.c)
10.2 Program Data
Program Data (g13bdce.d)
10.3 Program Results
Program Results (g13bdce.r)