Fits an ARIMA model, with forecast and residual checks (G. Tunnicliffe Wilson & S.J. Welham).

### Options

`PRINT` = string tokens |
Controls printed output (`description` , `monitoring` , `model` ); default `desc` , `moni` , `mode` |
---|---|

`GRAPHICS` = string token |
What type of graphics to use (`lineprinter` , `highresolution` ); default `high` |

`WINDOWS` = scalar or variate |
Windows to be used for residual plots: a scalar `N` indicates that plots are to be produced on separate pages in window `N` (as currently defined), whereas a variate specifies four separate windows to be redefined (within the procedure) for plotting four graphs on one page; default 1 |

`PENS` = variate |
The three pens to be used (after being defined appropriately) for drawing the plots; default `!(1,2,3)` |

### Parameters

`SERIES` = variates |
Holds the time series to which the model is to be fitted |
---|---|

`LENGTH` = scalars or variates |
Specifies the units to be used from each series: a scalar `N` indicates that the first `N` units of the series are to be used, a variate of length 2 gives the index of the first and last units of the subseries to be used; by default the whole series is used |

`ORDERS` = variates |
Variate holding the orders for the ARIMA model to be fitted to each series |

`PARAMETERS` = variates |
Variate specifying the initial values for the parameters (to be used by the `TFIT` directive) |

`TSM` = TSMs |
TSM to store each fitted model, also to supply values for orders and parameters if `ORDERS` and `PARAMETERS` are unset |

`RESIDUALS` = variates |
Variate to save the residuals from fitting the model to each series |

### Description

`BJESTIMATE`

fits an ARIMA model of specified orders to a time series given by the `SERIES`

parameter. If only part of the series is to be used, this should be specified by the parameter `LENGTH`

, using either a scalar `N`

to indicate that the first `N`

values should be used, or a variate of length 2 holding the positions of the first and last units of the subseries to be included. If only a subseries is used in the estimation, forecasts of any later series values are plotted to act as a check on the fitted model. The fit of the model is examined using the procedure `BJIDENTIFY`

on the residual series; this residual series is plotted, together with its sample autocorrelations, partial autocorrelations and periodogram. The residuals from the fitted model can be saved using the `RESIDUALS`

parameter.

The orders of the ARIMA model can be specified by the `ORDERS`

parameter; alternatively, if parameter `TSM`

has been set to the identifier of a TSM structure to save the results, `ORDERS`

can be omitted and the orders will be taken from those of the TSM. Likewise, the `PARAMETERS`

parameter can be set to a variate of initial values for the `TFIT`

directive, used by the procedure to fit the model; if `PARAMETERS`

is unset these will again be taken from the setting of the TSM parameter, if available. Any unset initial values are determined automatically by `TFIT`

.

Printed output is controlled by the option `PRINT`

; by default, a description of the series, monitoring of the estimation process and the fitted model are printed.

Graphical output is controlled by the options `GRAPHICS`

, `WINDOWS`

and `PENS`

. Option `GRAPHICS`

controls whether plots are produced for line-printer output or on the current high-resolution graphics device; by default high-resolution plots are given. Option `WINDOWS`

controls the way in which the high-resolution plots are arranged. First of all there may be a graph of forecasts; this is plotted on a new page (i.e. a cleared screen), using the first window specified. Then procedure `BJIDENTIFY`

is called to produce four different plots of residuals. If `WINDOWS`

is set to a scalar `N`

, the graphs are all produced in window `N`

on separate pages; the `FRAME`

directive can be used to set the attributes of window `N`

before calling the procedure. Alternatively, `WINDOWS`

can be set to a variate of length four; the attributes of the four windows specified are then redefined within the procedure so that four graphs are produced on the same page. By default `WINDOWS=1`

. The `PENS`

option controls which pens are used for the plots; the attributes of these pens are modified appropriately within the procedure. By default pens 1-3 are used, but these can be changed by setting option `PENS`

to a variate of length 3 containing the numbers of the three different pens required.

Options: `PRINT`

, `GRAPHICS`

, `WINDOWS`

, `PENS`

.

Parameters: `SERIES`

, `LENGTH`

, `ORDERS`

, `PARAMETERS`

, `TSM`

, `RESIDUALS`

.

### Method

The model is fitted using the default settings of directive `TFIT`

, and forecasts are constructed for increasing leadtimes using the directive `TFORECAST`

. `BJIDENTIFY`

is called to display time series statistics for the residual series after fitting the required ARIMA model.

### Action with `RESTRICT`

Input structures must not be restricted. Restriction of the input `SERIES`

to a contiguous set of units can be achieved using the `LENGTH`

parameter.

### See also

Directive: `TFIT`

.

Procedures: `BJFORECAST`

, `BJIDENTIFY`

.

Commands for: Time series.

### Example

CAPTION 'BJESTIMATE example', !t(\ 'Data from Andrews & Herzberg (1985), Data, A Collection',\ 'of Problems from Many Fields for the Student and Research',\ 'Worker, Springer-Verlag, pp. 369-370.'); STYLE=meta,plain VARIATE [VALUES=8.075,7.819,7.366,8.113,7.380,7.134,7.222,7.768,\ 7.386,6.965,6.478,8.105,8.060,7.684,7.580,7.093,\ 6.129,6.026,6.679,7.414,7.112,7.762,7.645,8.639,\ 7.667,8.080,6.678,6.739,5.569,5.049,5.642,6.808,\ 6.636,8.241,7.968,8.044,7.791,7.024,6.102,6.053,\ 5.941,5.386,5.811,6.716,6.923,6.939,6.705,6.914] Profit TSM Model; ORDERS=!(2,0,1,0,1,1,4);\ PARAMETERS=!(1,-0.1,0.2,1.6,-0.8,0.99,0.9) VARIATE [VALUES=1...4] Windows BJESTIMATE [PRINT=description,model; WINDOWS=Windows]\ Profit; LENGTH=40; TSM=Model " If the TSM was not to be saved, the orders would need to be supplied by the ORDERS parameter: i.e. BJESTIMATE Profit; LENGTH=40; ORDERS=!(2,0,1,0,1,1,4) " PRINT Model