Integer type:  int32  int64  nag_int  show int32  show int32  show int64  show int64  show nag_int  show nag_int

Chapter Contents
Chapter Introduction
NAG Toolbox

# NAG Toolbox: nag_tsa_multi_inputmod_forecast (g13bj)

## Purpose

nag_tsa_multi_inputmod_forecast (g13bj) produces forecasts of a time series (the output series) which depends on one or more other (input) series via a previously estimated multi-input model for which the state set information is not available. The future values of the input series must be supplied. In contrast with nag_tsa_multi_inputmod_forecast_state (g13bh) the original past values of the input and output series are required. Standard errors of the forecasts are produced. If future values of some of the input series have been obtained as forecasts using ARIMA models for those series, this may be allowed for in the calculation of the standard errors.

## Syntax

[para, xxy, rmsxy, mrx, fva, fsd, sttf, nsttf, ifail] = g13bj(mr, mt, para, kfc, nev, nfv, xxy, kzef, rmsxy, mrx, parx, isttf, 'nser', nser, 'npara', npara)
[para, xxy, rmsxy, mrx, fva, fsd, sttf, nsttf, ifail] = nag_tsa_multi_inputmod_forecast(mr, mt, para, kfc, nev, nfv, xxy, kzef, rmsxy, mrx, parx, isttf, 'nser', nser, 'npara', npara)

## Description

nag_tsa_multi_inputmod_forecast (g13bj) has two stages. The first stage is essentially the same as a call to the model estimation function nag_tsa_multi_inputmod_estim (g13be), with zero iterations. In particular, all the parameters remain unchanged in the supplied input series transfer function models and output noise series ARIMA model. The internal nuisance parameters associated with the pre-observation period effects of the input series are estimated where requested, and so are any backforecasts of the output noise series. The output components zt${z}_{t}$ and nt${n}_{t}$, and residuals at${a}_{t}$ are calculated exactly as in Section [Description] in (g13be), and the state set for forecasting is constituted.
The second stage is essentially the same as a call to the forecasting function nag_tsa_multi_inputmod_forecast_state (g13bh). The same information is required, and the same information is returned.
Use of nag_tsa_multi_inputmod_forecast (g13bj) should be confined to situations in which the state set for forecasting is unknown. Forecasting from the original data is relatively expensive because it requires recalculation of the state set. nag_tsa_multi_inputmod_forecast (g13bj) returns the state set for use in producing further forecasts using nag_tsa_multi_inputmod_forecast_state (g13bh), or for updating the state set using nag_tsa_multi_inputmod_update (g13bg).

## References

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

## Parameters

### Compulsory Input Parameters

1:     mr(7$7$) – int64int32nag_int array
The orders vector (p,d,q,P,D,Q,s)$\left(p,d,q,P,D,Q,s\right)$ of the ARIMA model for the output noise component.
p$p$, q$q$, P$P$ and Q$Q$ refer respectively to the number of autoregressive (φ)$\left(\varphi \right)$, moving average (θ)$\left(\theta \right)$, seasonal autoregressive (Φ)$\left(\Phi \right)$ and seasonal moving average (Θ)$\left(\Theta \right)$ parameters.
d$d$, D$D$ and s$s$ refer respectively to the order of non-seasonal differencing, the order of seasonal differencing and the seasonal period.
Constraints:
• p$p$, d$d$, q$q$, P$P$, D$D$, Q$Q$, s0$s\ge 0$;
• p + q + P + Q > 0$p+q+P+Q>0$;
• s1$s\ne 1$;
• if s = 0$s=0$, P + D + Q = 0$P+D+Q=0$;
• if s > 1$s>1$, P + D + Q > 0$P+D+Q>0$;
• d + s × (P + D)n$d+s×\left(P+D\right)\le n$;
• p + dq + s × (P + DQ)n$p+d-q+s×\left(P+D-Q\right)\le n$.
2:     mt(4$4$,nser) – int64int32nag_int array
The transfer function model orders b$b$, p$p$ and q$q$ of each of the input series. The data for input series i$i$ is held in column i$i$. Row 1 holds the value bi${b}_{i}$, row 2 holds the value qi${q}_{i}$ and row 3 holds the value pi${p}_{i}$.
For a simple input, bi = qi = pi = 0${b}_{i}={q}_{i}={p}_{i}=0$.
Row 4 holds the value ri${r}_{i}$, where ri = 1${r}_{i}=1$ for a simple input, and ri = 2​ or ​3${r}_{i}=2\text{​ or ​}3$ for a transfer function input.
The choice ri = 3${r}_{i}=3$ leads to estimation of the pre-period input effects as nuisance parameters, and ri = 2${r}_{i}=2$ suppresses this estimation. This choice may affect the returned forecasts and the state set.
When ri = 1${r}_{i}=1$, any nonzero contents of rows 1, 2 and 3 of column i$i$ are ignored.
Constraint: mt(4,i) = 1${\mathbf{mt}}\left(4,\mathit{i}\right)=1$, 2$2$ or 3$3$, for i = 1,2,,nser1$\mathit{i}=1,2,\dots ,{\mathbf{nser}}-1$.
3:     para(npara) – double array
Estimates of the multi-input model parameters. These are in order, firstly the ARIMA model parameters: p$p$ values of φ$\varphi$ parameters, q$q$ values of θ$\theta$ parameters, P$P$ values of Φ$\Phi$ parameters, Q$Q$ values of Θ$\Theta$ parameters.
These are followed by the transfer function model parameter values ω0,ω1,,ωq1${\omega }_{0},{\omega }_{1},\dots ,{\omega }_{{q}_{1}}$, δ1,,δp1${\delta }_{1},\dots ,{\delta }_{{p}_{1}}$ for the first of any input series and similarly for each subsequent input series. The final component of para is the value of the constant c$c$.
4:     kfc – int64int32nag_int scalar
Must be set to 1$1$ if the constant was estimated when the model was fitted, and 0$0$ if it was held at a fixed value. This only affects the degrees of freedom used in calculating the estimated residual variance.
Constraint: kfc = 0${\mathbf{kfc}}=0$ or 1$1$.
5:     nev – int64int32nag_int scalar
The number of original (undifferenced) values in each of the input and output time series.
6:     nfv – int64int32nag_int scalar
The number of forecast values of the output series required.
Constraint: nfv > 0${\mathbf{nfv}}>0$.
7:     xxy(ldxxy,nser) – double array
ldxxy, the first dimension of the array, must satisfy the constraint ldxxy(nev + nfv)$\mathit{ldxxy}\ge \left({\mathbf{nev}}+{\mathbf{nfv}}\right)$.
The columns of xxy must contain in the first nev places, the past values of each of the input and output series, in that order. In the next nfv places, the columns relating to the input series (i.e., columns 1$1$ to nser1${\mathbf{nser}}-1$) contain the future values of the input series which are necessary for construction of the forecasts of the output series y$y$.
8:     kzef – int64int32nag_int scalar
Must be set to 0$0$ if the relevant nfv values of the forecasts (fva) are to be held in the output series column (nser) of xxy (which is otherwise unchanged) on exit, and must not be set to 0$0$ if the values of the input component series zt${z}_{t}$ and the values of the output noise component nt${n}_{t}$ are to overwrite the contents of xxy on exit.
9:     rmsxy(nser) – double array
The first (nser1)$\left({\mathbf{nser}}-1\right)$ elements of rmsxy must contain the estimated residual variance of the input series ARIMA models. In the case of those inputs for which no ARIMA model is available or its effects are to be excluded in the calculation of forecast standard errors, the corresponding entry of rmsxy should be set to 0$0$.
10:   mrx(7$7$,nser) – int64int32nag_int array
The orders array for each of the input series ARIMA models. Thus, column i$i$ contains values of p$p$, d$d$, q$q$, P$P$, D$D$, Q$Q$, s$s$ for input series i$i$. In the case of those inputs for which no ARIMA model is available, the corresponding orders should be set to 0$0$.
11:   parx(ldparx,nser) – double array
ldparx, the first dimension of the array, must satisfy the constraint ldparxnce$\mathit{ldparx}\ge \mathit{nce}$, where nce$\mathit{nce}$ is the maximum number of parameters in any of the input series ARIMA models. If there are no input series, then ldparx1$\mathit{ldparx}\ge 1$.
Values of the parameters (φ$\varphi$, θ$\theta$, Φ$\Phi$, and Θ$\Theta$) for each of the input series ARIMA models.
Thus column i$i$ contains mrx(1,i)${\mathbf{mrx}}\left(1,i\right)$ values of φ$\varphi$, mrx(3,i)${\mathbf{mrx}}\left(3,i\right)$ values of θ$\theta$, mrx(4,i)${\mathbf{mrx}}\left(4,i\right)$ values of Φ$\Phi$ and mrx(6,i)${\mathbf{mrx}}\left(6,i\right)$ values of Θ$\Theta$, in that order.
Values in the columns relating to those input series for which no ARIMA model is available are ignored.
12:   isttf – int64int32nag_int scalar
The dimension of the array sttf as declared in the (sub)program from which nag_tsa_multi_inputmod_forecast (g13bj) is called.
Constraint: isttf(P × s) + d + (D × s) + q + max (p,Q × s) + ncf${\mathbf{isttf}}\ge \left(P×s\right)+d+\left(D×s\right)+q+\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(p,Q×s\right)+\mathit{ncf}$, where
ncf = (bi + qi + pi)$\mathit{ncf}=\sum \left({b}_{i}+{q}_{i}+{p}_{i}\right)$ and the summation is over all input series for which ri > 1${r}_{i}>1$.

### Optional Input Parameters

1:     nser – int64int32nag_int scalar
Default: The dimension of the arrays mt, mrx, rmsxy and the second dimension of the arrays xxy, parx. (An error is raised if these dimensions are not equal.)
The number of input and output series. There may be any number of input series (including none), but only one output series.
2:     npara – int64int32nag_int scalar
Default: The dimension of the array para.
The exact number of φ$\varphi$, θ$\theta$, Φ$\Phi$, Θ$\Theta$, ω$\omega$, δ$\delta$, c$c$ parameters, so that npara = p + q + P + Q + nser + (p + q)${\mathbf{npara}}=p+q+P+Q+{\mathbf{nser}}+\sum \left(p+q\right)$, the summation being over all the input series. (c$c$ must be included whether its value was previously estimated or was set fixed.)

### Input Parameters Omitted from the MATLAB Interface

ldxxy ldparx wa iwa mwa imwa

### Output Parameters

1:     para(npara) – double array
The parameter values may be updated using an additional iteration in the estimation process.
2:     xxy(ldxxy,nser) – double array
ldxxy(nev + nfv)$\mathit{ldxxy}\ge \left({\mathbf{nev}}+{\mathbf{nfv}}\right)$.
If kzef = 0${\mathbf{kzef}}=0$ then xxy is unchanged except that the relevant nfv values in the column relating to the output series (column nser) contain the forecast values (fva), but if kzef0${\mathbf{kzef}}\ne 0$ then the columns of xxy contain the corresponding values of the input component series zt${z}_{t}$ and the values of the output noise component nt${n}_{t}$, in that order.
3:     rmsxy(nser) – double array
${\mathbf{rmsxy}}\left({\mathbf{nser}}\right)$ contains the estimated residual variance of the output noise ARIMA model which is calculated from the supplied series. Otherwise rmsxy is unchanged.
4:     mrx(7$7$,nser) – int64int32nag_int array
Unchanged, except for column nser which is used as workspace.
5:     fva(nfv) – double array
The required forecast values for the output series. (Note that these are also output in column nser of xxy if kzef = 0${\mathbf{kzef}}=0$.)
6:     fsd(nfv) – double array
The standard errors for each of the forecast values.
7:     sttf(isttf) – double array
The nsttf values of the state set based on the first nev sets of (past) values of the input and output series.
8:     nsttf – int64int32nag_int scalar
The number of values in the state set array sttf.
9:     ifail – int64int32nag_int scalar
${\mathrm{ifail}}={\mathbf{0}}$ unless the function detects an error (see [Error Indicators and Warnings]).

## Error Indicators and Warnings

Errors or warnings detected by the function:
ifail = 1${\mathbf{ifail}}=1$
 On entry, kfc < 0${\mathbf{kfc}}<0$, or kfc > 1${\mathbf{kfc}}>1$, or ldxxy < (nev + nfv)$\mathit{ldxxy}<\left({\mathbf{nev}}+{\mathbf{nfv}}\right)$, or nfv ≤ 0${\mathbf{nfv}}\le 0$.
ifail = 2${\mathbf{ifail}}=2$
On entry, ldparx is too small or npara is inconsistent with the orders specified in arrays mr and mt; or one of the ri${r}_{i}$, stored in mt(4,i)${\mathbf{mt}}\left(4,i\right)$, does not equal 1$1$, 2$2$ or 3$3$.
ifail = 3${\mathbf{ifail}}=3$
On entry or during execution, one or more sets of δ$\delta$ parameters do not satisfy the stationarity or invertibility test conditions.
ifail = 4${\mathbf{ifail}}=4$
On entry, iwa is too small for the final forecasting calculations. This is a highly unlikely error, and would probably indicate that nfv was abnormally large.
ifail = 5${\mathbf{ifail}}=5$
On entry, iwa is too small by a very considerable margin. No information is supplied about the requisite minimum size.
ifail = 6${\mathbf{ifail}}=6$
 On entry, iwa is too small, but the requisite minimum size is returned in mwa(1)$\mathit{mwa}\left(1\right)$.
ifail = 7${\mathbf{ifail}}=7$
 On entry, imwa is too small, but the requisite minimum size is returned in mwa(1)$\mathit{mwa}\left(1\right)$.
ifail = 8${\mathbf{ifail}}=8$
This indicates a failure in nag_linsys_real_posdef_solve_1rhs (f04as) which is used to solve the equations giving the latest estimates of the parameters.
ifail = 9${\mathbf{ifail}}=9$
This indicates a failure in the inversion of the second derivative matrix associated with parameter estimation.
ifail = 10${\mathbf{ifail}}=10$
On entry or during execution, one or more sets of the ARIMA (φ$\varphi$, θ$\theta$, Φ$\Phi$ or Θ$\Theta$) parameters do not satisfy the stationarity or invertibility test conditions.
ifail = 11${\mathbf{ifail}}=11$
 On entry, isttf is too small.

## Accuracy

The computations are believed to be stable.

The time taken by nag_tsa_multi_inputmod_forecast (g13bj) is approximately proportional to the product of the length of each series and the square of the number of parameters in the multi-input model.

## Example

```function nag_tsa_multi_inputmod_forecast_example
mr = [int64(1);0;0;0;0;1;4];
mt = [int64(0),0,0,0,1,0; ...
0,0,0,0,0,0; ...
0,0,0,0,1,0; ...
1,1,1,1,3,0];
para = [0.495; 0.238; -0.367; -3.876; 4.516; 2.474; 8.629; 0.688; -82.858];
kfc = int64(1);
nev = int64(40);
nfv = int64(8);
xxy = [1, 1, 0, 0, 8.075, 105; 1, 0, 1, 0, 7.819, 119; 1, 0, ...
0, 1, 7.366, 119; 1, -1, -1, -1, 8.113, 109; 2, 1, 0, 0, 7.38, 117; 2, ...
0, 1, 0, 7.134, 135; 2, 0, 0, 1, 7.222, 126; 2, -1, -1, -1, 7.768, 112; 3, ...
1, 0, 0, 7.386, 116; 3, 0, 1, 0, 6.965, 122; 3, 0, 0, 1, 6.478, 115; 3, ...
-1, -1, -1, 8.105, 115; 4, 1, 0, 0, 8.06, 122; 4, 0, 1, 0, 7.684, 138; 4, ...
0, 0, 1, 7.58, 135; 4, -1, -1, -1, 7.093, 125; 5, 1, 0, 0, 6.129, 115; 5, ...
0, 1, 0, 6.026, 108; 5, 0, 0, 1, 6.679, 100; 5, -1, -1, -1, 7.414, 96; 6, ...
1, 0, 0, 7.112, 107; 6, 0, 1, 0, 7.762, 115; 6, 0, 0, 1, 7.645, 123; 6, ...
-1, -1, -1, 8.639, 122; 7, 1, 0, 0, 7.667, 128; 7, 0, 1, 0, ...
8.08, 136; 7, 0, 0, 1, 6.678, 140; 7, -1, -1, -1, 6.739, 122; 8, 1, ...
0, 0, 5.569, 102; 8, 0, 1, 0, 5.049, 103; 8, 0, 0, 1, 5.642, 89; 8, -1, -1, ...
-1, 6.808, 77; 9, 1, 0, 0, 6.636, 89; 9, 0, 1, 0, 8.241, 94; 9, 0, 0, ...
1, 7.968, 104; 9, -1, -1, -1, 8.044, 108; 10, 1, 0, 0, 7.791, 119; 10, 0, ...
1, 0, 7.024, 126; 10, 0, 0, 1, 6.102, 119; 10, -1, -1, -1, 6.053, 103; 11, ...
1, 0, 0, 5.941, 0; 11, 0, 1, 0, 5.386, 0; 11, 0, 0, 1, 5.811, 0; 11, ...
-1, -1, -1, 6.716, 0; 12, 1, 0, 0, 6.923, 0; 12, 0, 1, 0, 6.939, 0; 12, ...
0, 0, 1, 6.705, 0; 12, -1, -1, -1, 6.914, 0; 0, 0, 0, 0, 0, 0; 0, 0, 0, 0, 0, 0];
kzef = int64(1);
rmsxy = [0; 0; 0; 0; 0.172; 0];
mrx = [int64(0),0,0,0,2,0; ...
0,0,0,0,0,0; ...
0,0,0,0,2,0; ...
0,0,0,0,0,0; ...
0,0,0,0,1,0; ...
0,0,0,0,1,0; ...
0,0,0,0,4,0];
parx = [0, 0, 0, 0, 1.6743, 0; 0, 0, 0, 0, -0.9505, 0; 0, 0, 0, 0, 1.4605,0; ...
0, 0, 0, 0, -0.4862, 0; 0, 0, 0, 0, 0.8993, 0];
isttf = int64(20);
[paraOut, xxyOut, rmsxyOut, mrxOut, fva, fsd, sttf, nsttf, ifail] = ...
nag_tsa_multi_inputmod_forecast(mr, mt, para, kfc, nev, nfv, xxy, kzef, rmsxy, mrx, parx, isttf)
```
```

paraOut =

0.4950
0.2380
-0.3391
-3.8886
4.5139
2.4789
8.6290
0.6880
-82.8580

xxyOut =

-0.3391   -3.8886         0         0  188.6028  -79.3751
-0.3391         0    4.5139         0  199.4379  -84.6127
-0.3391         0         0    2.4789  204.6834  -87.8232
-0.3391    3.8886   -4.5139   -2.4789  204.3834  -91.9402
-0.6782   -3.8886         0         0  210.6229  -89.0560
-0.6782         0    4.5139         0  208.5905  -77.4262
-0.6782         0         0    2.4789  205.0696  -80.8703
-0.6782    3.8886   -4.5139   -2.4789  203.4065  -87.6242
-1.0173   -3.8886         0         0  206.9738  -86.0678
-1.0173         0    4.5139         0  206.1317  -87.6283
-1.0173         0         0    2.4789  201.9196  -88.3812
-1.0173    3.8886   -4.5139   -2.4789  194.8194  -75.6979
-1.3564   -3.8886         0         0  203.9738  -76.7287
-1.3564         0    4.5139         0  209.8837  -75.0412
-1.3564         0         0    2.4789  210.7052  -76.8277
-1.3564    3.8886   -4.5139   -2.4789  210.3730  -80.9125
-1.6955   -3.8886         0         0  205.9421  -85.3580
-1.6955         0    4.5139         0  194.5753  -89.3937
-1.6955         0         0    2.4789  185.8662  -86.6496
-1.6955    3.8886   -4.5139   -2.4789  185.5090  -84.7094
-2.0346   -3.8886         0         0  191.6056  -78.6824
-2.0346         0    4.5139         0  193.1941  -80.6734
-2.0346         0         0    2.4789  199.8958  -77.3402
-2.0346    3.8886   -4.5139   -2.4789  203.4970  -76.3583
-2.3737   -3.8886         0         0  214.5519  -80.2896
-2.3737         0    4.5139         0  213.7702  -79.9104
-2.3737         0         0    2.4789  216.7963  -76.9015
-2.3737    3.8886   -4.5139   -2.4789  206.7803  -79.3024
-2.7128   -3.8886         0         0  200.4157  -91.8142
-2.7128         0    4.5139         0  185.9409  -84.7420
-2.7128         0         0    2.4789  171.4951  -82.2613
-2.7128    3.8886   -4.5139   -2.4789  166.6735  -83.8565
-3.0519   -3.8886         0         0  173.4176  -77.4771
-3.0519         0    4.5139         0  176.5733  -84.0353
-3.0519         0         0    2.4789  192.5940  -88.0211
-3.0519    3.8886   -4.5139   -2.4789  201.2606  -87.1045
-3.3910   -3.8886         0         0  207.8790  -81.5993
-3.3910         0    4.5139         0  210.2493  -85.3721
-3.3910         0         0    2.4789  205.2616  -85.3495
-3.3910    3.8886   -4.5139   -2.4789  193.8741  -84.3790
-3.7301   -3.8886         0         0  185.6167  -84.6003
-3.7301         0    4.5139         0  178.9692  -82.7953
-3.7301         0         0    2.4789  169.6066  -82.3091
-3.7301    3.8886   -4.5139   -2.4789  166.8325  -82.4095
-4.0692   -3.8886         0         0  172.7331  -82.6360
-4.0692         0    4.5139         0  178.5789  -82.7481
-4.0692         0         0    2.4789  182.7389  -82.8036
-4.0692    3.8886   -4.5139   -2.4789  183.5818  -82.8311
0         0         0         0         0         0
0         0         0         0         0         0

rmsxyOut =

0
0
0
0
0.1720
20.7599

mrxOut =

Columns 1 through 4

0                    0                    0                    0
0                    0                    0                    0
0                    0                    0                    0
0                    0                    0                    0
0                    0                    0                    0
0                    0                    0                    0
0                    0                    0                    0

Columns 5 through 6

2                    1
0                    0
2                    0
0                    0
1                    0
1                    1
4                    4

fva =

93.3977
96.9577
86.0463
77.5887
82.1393
96.2755
98.3451
93.5774

fsd =

4.5563
6.2172
7.0933
7.3489
7.3941
7.5823
8.1445
8.8536

sttf =

6.0530
193.8741
2.0790
-2.8580
-3.5906
-2.5203
0
0
0
0
0
0
0
0
0
0
0
0
0
0

nsttf =

6

ifail =

0

```
```function g13bj_example
mr = [int64(1);0;0;0;0;1;4];
mt = [int64(0),0,0,0,1,0; ...
0,0,0,0,0,0; ...
0,0,0,0,1,0; ...
1,1,1,1,3,0];
para = [0.495; 0.238; -0.367; -3.876; 4.516; 2.474; 8.629; 0.688; -82.858];
kfc = int64(1);
nev = int64(40);
nfv = int64(8);
xxy = [1, 1, 0, 0, 8.075, 105; 1, 0, 1, 0, 7.819, 119; 1, 0, ...
0, 1, 7.366, 119; 1, -1, -1, -1, 8.113, 109; 2, 1, 0, 0, 7.38, 117; 2, ...
0, 1, 0, 7.134, 135; 2, 0, 0, 1, 7.222, 126; 2, -1, -1, -1, 7.768, 112; 3, ...
1, 0, 0, 7.386, 116; 3, 0, 1, 0, 6.965, 122; 3, 0, 0, 1, 6.478, 115; 3, ...
-1, -1, -1, 8.105, 115; 4, 1, 0, 0, 8.06, 122; 4, 0, 1, 0, 7.684, 138; 4, ...
0, 0, 1, 7.58, 135; 4, -1, -1, -1, 7.093, 125; 5, 1, 0, 0, 6.129, 115; 5, ...
0, 1, 0, 6.026, 108; 5, 0, 0, 1, 6.679, 100; 5, -1, -1, -1, 7.414, 96; 6, ...
1, 0, 0, 7.112, 107; 6, 0, 1, 0, 7.762, 115; 6, 0, 0, 1, 7.645, 123; 6, ...
-1, -1, -1, 8.639, 122; 7, 1, 0, 0, 7.667, 128; 7, 0, 1, 0, ...
8.08, 136; 7, 0, 0, 1, 6.678, 140; 7, -1, -1, -1, 6.739, 122; 8, 1, ...
0, 0, 5.569, 102; 8, 0, 1, 0, 5.049, 103; 8, 0, 0, 1, 5.642, 89; 8, -1, -1, ...
-1, 6.808, 77; 9, 1, 0, 0, 6.636, 89; 9, 0, 1, 0, 8.241, 94; 9, 0, 0, ...
1, 7.968, 104; 9, -1, -1, -1, 8.044, 108; 10, 1, 0, 0, 7.791, 119; 10, 0, ...
1, 0, 7.024, 126; 10, 0, 0, 1, 6.102, 119; 10, -1, -1, -1, 6.053, 103; 11, ...
1, 0, 0, 5.941, 0; 11, 0, 1, 0, 5.386, 0; 11, 0, 0, 1, 5.811, 0; 11, ...
-1, -1, -1, 6.716, 0; 12, 1, 0, 0, 6.923, 0; 12, 0, 1, 0, 6.939, 0; 12, ...
0, 0, 1, 6.705, 0; 12, -1, -1, -1, 6.914, 0; 0, 0, 0, 0, 0, 0; 0, 0, 0, 0, 0, 0];
kzef = int64(1);
rmsxy = [0; 0; 0; 0; 0.172; 0];
mrx = [int64(0),0,0,0,2,0; ...
0,0,0,0,0,0; ...
0,0,0,0,2,0; ...
0,0,0,0,0,0; ...
0,0,0,0,1,0; ...
0,0,0,0,1,0; ...
0,0,0,0,4,0];
parx = [0, 0, 0, 0, 1.6743, 0; 0, 0, 0, 0, -0.9505, 0; 0, 0, 0, 0, 1.4605,0; ...
0, 0, 0, 0, -0.4862, 0; 0, 0, 0, 0, 0.8993, 0];
isttf = int64(20);
[paraOut, xxyOut, rmsxyOut, mrxOut, fva, fsd, sttf, nsttf, ifail] = ...
g13bj(mr, mt, para, kfc, nev, nfv, xxy, kzef, rmsxy, mrx, parx, isttf)
```
```

paraOut =

0.4950
0.2380
-0.3391
-3.8886
4.5139
2.4789
8.6290
0.6880
-82.8580

xxyOut =

-0.3391   -3.8886         0         0  188.6028  -79.3751
-0.3391         0    4.5139         0  199.4379  -84.6127
-0.3391         0         0    2.4789  204.6834  -87.8232
-0.3391    3.8886   -4.5139   -2.4789  204.3834  -91.9402
-0.6782   -3.8886         0         0  210.6229  -89.0560
-0.6782         0    4.5139         0  208.5905  -77.4262
-0.6782         0         0    2.4789  205.0696  -80.8703
-0.6782    3.8886   -4.5139   -2.4789  203.4065  -87.6242
-1.0173   -3.8886         0         0  206.9738  -86.0678
-1.0173         0    4.5139         0  206.1317  -87.6283
-1.0173         0         0    2.4789  201.9196  -88.3812
-1.0173    3.8886   -4.5139   -2.4789  194.8194  -75.6979
-1.3564   -3.8886         0         0  203.9738  -76.7287
-1.3564         0    4.5139         0  209.8837  -75.0412
-1.3564         0         0    2.4789  210.7052  -76.8277
-1.3564    3.8886   -4.5139   -2.4789  210.3730  -80.9125
-1.6955   -3.8886         0         0  205.9421  -85.3580
-1.6955         0    4.5139         0  194.5753  -89.3937
-1.6955         0         0    2.4789  185.8662  -86.6496
-1.6955    3.8886   -4.5139   -2.4789  185.5090  -84.7094
-2.0346   -3.8886         0         0  191.6056  -78.6824
-2.0346         0    4.5139         0  193.1941  -80.6734
-2.0346         0         0    2.4789  199.8958  -77.3402
-2.0346    3.8886   -4.5139   -2.4789  203.4970  -76.3583
-2.3737   -3.8886         0         0  214.5519  -80.2896
-2.3737         0    4.5139         0  213.7702  -79.9104
-2.3737         0         0    2.4789  216.7963  -76.9015
-2.3737    3.8886   -4.5139   -2.4789  206.7803  -79.3024
-2.7128   -3.8886         0         0  200.4157  -91.8142
-2.7128         0    4.5139         0  185.9409  -84.7420
-2.7128         0         0    2.4789  171.4951  -82.2613
-2.7128    3.8886   -4.5139   -2.4789  166.6735  -83.8565
-3.0519   -3.8886         0         0  173.4176  -77.4771
-3.0519         0    4.5139         0  176.5733  -84.0353
-3.0519         0         0    2.4789  192.5940  -88.0211
-3.0519    3.8886   -4.5139   -2.4789  201.2606  -87.1045
-3.3910   -3.8886         0         0  207.8790  -81.5993
-3.3910         0    4.5139         0  210.2493  -85.3721
-3.3910         0         0    2.4789  205.2616  -85.3495
-3.3910    3.8886   -4.5139   -2.4789  193.8741  -84.3790
-3.7301   -3.8886         0         0  185.6167  -84.6003
-3.7301         0    4.5139         0  178.9692  -82.7953
-3.7301         0         0    2.4789  169.6066  -82.3091
-3.7301    3.8886   -4.5139   -2.4789  166.8325  -82.4095
-4.0692   -3.8886         0         0  172.7331  -82.6360
-4.0692         0    4.5139         0  178.5789  -82.7481
-4.0692         0         0    2.4789  182.7389  -82.8036
-4.0692    3.8886   -4.5139   -2.4789  183.5818  -82.8311
0         0         0         0         0         0
0         0         0         0         0         0

rmsxyOut =

0
0
0
0
0.1720
20.7599

mrxOut =

Columns 1 through 4

0                    0                    0                    0
0                    0                    0                    0
0                    0                    0                    0
0                    0                    0                    0
0                    0                    0                    0
0                    0                    0                    0
0                    0                    0                    0

Columns 5 through 6

2                    1
0                    0
2                    0
0                    0
1                    0
1                    1
4                    4

fva =

93.3977
96.9577
86.0463
77.5887
82.1393
96.2755
98.3451
93.5774

fsd =

4.5563
6.2172
7.0933
7.3489
7.3941
7.5823
8.1445
8.8536

sttf =

6.0530
193.8741
2.0790
-2.8580
-3.5906
-2.5203
0
0
0
0
0
0
0
0
0
0
0
0
0
0

nsttf =

6

ifail =

0

```