Forms preliminary estimates of parameters in time-series models.

### Option

`PRINT` = string tokens |
What to print (`models` ); default `*` |
---|

### Parameters

`TSM` = TSMs |
Models whose parameters are to be estimated |
---|---|

`CORRELATIONS` = variates |
Auto- or cross-correlations on which to base estimates for each model |

`BOXCOXTRANSFORM` = scalars |
Box-Cox transformation parameter |

`CONSTANT` = scalars |
Constant term |

`VARIANCE` = scalars |
Variance of `ARIMA` model, or ratio of input variance to output variance for transfer model |

### Description

The `TFIT`

directive carries out a lot of computation to find the best estimates of the parameters of a time-series model. The amount of computation can be reduced if you provide rough initial values for the parameters, especially when there are many of them. This can be done using the `FTSM`

directive. `FTSM`

obtains moment estimators of a simple kind, by solving equations between the unknown parameters of the ARIMA or transfer-function model and the autocorrelations or cross-correlations calculated from the observed time series. Sometimes these equations have no solution, or their solution provides values inconsistent with the constraints demanded of the parameters. If so, Genstat sets the corresponding parameters to missing values. The form of the directive is the same for ARIMA and transfer-function models, but the interpretation is slightly different.

To obtain preliminary estimates of ARIMA model parameters, a typical `FTSM`

statement might be

`FTSM [PRINT=model] Yatsm; CORRELATIONS=Yacf; BOXCOX=Ytran;\`

` CONSTANT=Ymean; VARIANCE=Yvar`

You must previously have declared `Yatsm`

to be a `TSM`

structure (i.e. a time-series model structure) of type `ARIMA`

with appropriate orders, and lags if you need to specify them. Genstat takes this model to be associated with observations of a time series *y _{t}*. The aim of the directive is to set the values of the variate of model parameters equal to preliminary estimates derived from the variate

`Yacf`

and scalars `Ytran`

, `Ymn`

and `Yvar`

.The variate `Yacf`

should contain sample autocorrelations *r*_{0} … *r _{m}*. You should obtain these from the original time series, stored in variate

`Y`

say, by first using the `CALCULATE`

directive to transform `Y`

according to the Box-Cox equations with transformation parameter `Ytran`

(if you do indeed want a transformation). You should then form the differences of the transformed series, according to the degrees of differencing already set in the model; you can use the `DIFFERENCE`

function with the `CALCULATE`

directive for this. Finally, you should use the `AUTOCORRELATIONS`

parameter of the `CORRELATE`

directive to store the autocorrelations of the resulting series in `Yacf`

. Often you will have done these operations already in order to produce `Yacf`

for selecting a model.At the same time, you can supply the scalars `Ytran`

, `Ymean`

and `Yvar`

to set the first three elements of the parameters variate of `Yatsm`

; these cannot be set using `Yacf`

alone. The scalar `Ytran`

should be the parameter used to transform `Y`

, and Genstat will copy it into the first element of the variate of parameters. Genstat will copy the scalar `Ymean`

into the second element, which is the constant term of the model; the recommended value for this is the sample mean of the series from which `Yacf`

is calculated, but you may prefer the value 0. The scalar `Yvar`

is used to set the innovation variance, which is the third element of the variate of parameters. The recommended value is the sample variance of the series from which `Yacf`

is calculated. If you set `Yvar`

to 1.0, then Genstat will set the innovation variance to the variance ratio Variance(*e*)/Variance(*y*), as estimated from `Yacf`

according to the model.

If any of the `BOXCOX`

, `CONSTANT`

or `VARIANCE`

parameters is not set, Genstat will leave unchanged the corresponding value in the variate of parameters of the model. The only exception to this rule is if a parameter is missing. Then Genstat initially sets the transformation parameter to 1.0 (corresponding to no transformation), and the constant to 0.0; the innovation variance is left missing.

A typical `FTSM`

statement for a transfer-function model might be

`FTSM [PRINT=model] Xytsm; CORRELATIONS=Xyccf; BOXCOX=Xtran;\`

` CONSTANT=Xmean; VARIANCE=Xyvratio`

You must previously have declared the time-series model `Xytsm`

to be of type `transferfunction`

with appropriate orders, and lags if you need to specify them. Genstat assumes that this model represents the dependence of an output series *y _{t}* on an input series

*x*in a multi-input model. The directive sets the values of the parameters of the model equal to preliminary estimates derived from

_{t}`Xyccf`

, `Xtran`

, `Xmean`

and `Xyvratio`

.You should put into the variate `Xyccf`

an estimate of the impulse-response function of the model, from which Genstat will derive the parameters. This estimate is usually a sample cross-correlation sequence *r*_{0} … *r _{m}* obtained from variates

`Y`

and `X1`

containing observations of *y*and

_{t}*x*according to one of the following four rules:

_{t}(a) In the simple case, the differencing orders of `Xytsm`

are all zero, and you do not want to use any Box-Cox transformation of either *y _{t}* or

*x*. Then the cross-correlations should be those between variates

_{t}`Alpha`

and `Beta`

, say, derived from `X`

and `Y`

by filtering (or pre-whitening), see the `TFILTER`

directive. The ARIMA model that you used for the filter should be the same for `X`

and `Y`

, and you should choose it so that the values of `Alpha`

represent white noise.(b) If the differencing orders of `Xytsm`

are not zero, then before you calculate the cross-correlations you should further difference the series `Beta`

as specified by these orders.

(c) If a Box-Cox transformation is associated with *y _{t}*, you should apply it to

`Y`

before the filtering. However this transformation parameter must not be associated with `Xytsm`

: you should assign it to the univariate ARIMA model that you have specified for the error term.(d) If a Box-Cox transformation is associated with *x _{t}*, it must be the same as the one you used in the ARIMA model for

*x*from which the series

_{t}`Alpha`

was derived. The scalar `Xtran`

must contain this transformation parameter. Genstat copies it into the first element of the parameter variate of `Xytsm`

. If the Box-Cox parameter is unset, Genstat leaves the transformation parameter of `Xytsm`

unchanged; it is set to 1.0 if it was originally missing.Genstat copies the scalar `Xmean`

into the second element of the variate of parameters. The recommended value is the sample mean of `X`

after any transformation has been applied. If you do not set the `CONSTANT`

parameter, Genstat leaves the constant parameter of `Xytsm`

unchanged; it is set to 0.0 if it was originally missing.

You use the scalar `Xyvratio`

to obtain the correct scaling of non-seasonal moving-average parameters in `Xytsm`

. All the other autoregressive parameters and moving-average parameters are invariant under scale changes in *y _{t}* and

*x*. You should set the scalar to the ratio of the sample variances of the variates from which the cross-correlations were calculated; that is, Variance(

_{t}`Beta`

)/Variance(`Alpha`

). If you do not set this, Genstat uses the value 1.0.You can use `FTSM`

to go backwards from autocorrelations to the original time-series model. If you apply it to the autocorrelations that were constructed from a time-series model by means of `TSUMMARIZE`

, it will recover the parameters of the model exactly, provided the model is non-seasonal. If the model contains seasonal parameters, with seasonal period *s*, the parameters will not be recovered exactly, except in one special circumstance: that is, when the non-seasonal part of the model, considered in isolation from the seasonal part, has a theoretical autocorrelation function that is zero beyond lag *s*/2. Otherwise, the non-seasonal and seasonal parts of the model interact, and so Genstat loses accuracy in the recovered parameters. When you use sample autocorrelations, this loss of accuracy tends to be small in comparison with the sampling fluctuations of the estimates. But if *s* is small, say *s*=4 for quarterly data, the loss could be serious. Exactly the same considerations apply to transfer-function models.

Option: `PRINT`

.

Parameters: `TSM`

, `CORRELATIONS`

, `BOXCOXTRANSFORM`

, `CONSTANT`

, `VARIANCE`

.

### See also

Directives: `TSM`

, `TDISPLAY`

, `TFILTER`

, `TFIT`

, `TFORECAST`

, `TKEEP`

, `TRANSFERFUNCTION`

, `TSUMMARIZE`

.

Procedures: `BJESTIMATE`

, `BJFORECAST`

, `BJIDENTIFY`

.

Commands for: Time series.

### Example

" Example TFIT-1: Fitting a seasonal ARIMA model" VARIATE time; VALUES=!(1...120) FILEREAD [NAME='%gendir%/examples/TFIT-1.DAT'] apt " Display the correlation structure of the logged data" CALCULATE lapt = LOG(apt) BJIDENTIFY [GRAPHICS=high; WINDOWS=!(5,6,7,8)] lapt " Calculate the autocorrelations of the differences and seasonally differenced series" CALCULATE ddslapt = DIFFERENCE(DIFFERENCE(lapt; 12); 1) CORRELATE [PRINT=auto; MAXLAG=48] ddslapt; AUTO=ddsr " Define a model for the series: IMA(1) (that is, a model with a single moving-average parameter applied to the differences of the series) plus a seasonal IMA(1) component" TSM [MODELTYPE=arima] airpass; ORDERS=!((0,1,1)2,12) " Form preliminary estimates of the parameters, using a log transformation (BOXCOX=0 is equivalent to log)" FTSM [PRINT=model] airpass; ddsr; BOXCOX=0 " Get the best estimates, fixing the constant" TFIT [CONSTANT=fix] SERIES=apt; TSM=airpass " Graph the residuals against time" TKEEP RESID=resids DGRAPH [WINDOW=3; KEYWINDOW=0; TITLE='Residuals vs Time'] resids; time " Test the independence of the residuals" CORRELATE [GRAPH=auto; MAXLAG=48] resids; TEST=S PRINT 'Test statistic for independence of the residuals',S