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_uni_arma_roots (g13dx)

## Purpose

nag_tsa_uni_arma_roots (g13dx) calculates the zeros of a vector autoregressive (or moving average) operator. This function is likely to be used in conjunction with nag_rand_times_mv_varma (g05pj), nag_tsa_uni_arima_resid (g13as), nag_tsa_multi_varma_estimate (g13dd) or nag_tsa_multi_varma_diag (g13ds).

## Syntax

[rr, ri, rmod, ifail] = g13dx(k, ip, par)
[rr, ri, rmod, ifail] = nag_tsa_uni_arma_roots(k, ip, par)

## Description

Consider the vector autoregressive moving average (VARMA) model
 Wt − μ = φ1(Wt − 1 − μ) + φ2(Wt − 2 − μ) + ⋯ + φp(Wt − p − μ) + εt − θ1εt − 1 − θ2εt − 2 − ⋯ − θqεt − q, $Wt-μ=ϕ1(Wt-1-μ)+ϕ2(Wt-2-μ)+⋯+ϕp(Wt-p-μ)+εt-θ1εt-1-θ2εt-2-⋯-θqεt-q,$ (1)
where Wt${W}_{t}$ denotes a vector of k$k$ time series and εt${\epsilon }_{t}$ is a vector of k$k$ residual series having zero mean and a constant variance-covariance matrix. The components of εt${\epsilon }_{t}$ are also assumed to be uncorrelated at non-simultaneous lags. φ1,φ2,,φp${\varphi }_{1},{\varphi }_{2},\dots ,{\varphi }_{p}$ denotes a sequence of k$k$ by k$k$ matrices of autoregressive (AR) parameters and θ1,θ2,,θq${\theta }_{1},{\theta }_{2},\dots ,{\theta }_{q}$ denotes a sequence of k$k$ by k$k$ matrices of moving average (MA) parameters. μ$\mu$ is a vector of length k$k$ containing the series means. Let
A(φ) =
 [ φ1 I 0 . . . 0 φ2 0 I 0 . . 0 . . . . . . φp − 1 0 . . . 0 I φp 0 . . . 0 0 ]
pk × pk
$A(ϕ)= [ ϕ1 I 0 . . . 0 ϕ2 0 I 0 . . 0 . . . . . . ϕp-1 0 . . . 0 I ϕp 0 . . . 0 0 ] pk×pk$
where I$I$ denotes the k$k$ by k$k$ identity matrix.
The model (1) is said to be stationary if the eigenvalues of A(φ)$A\left(\varphi \right)$ lie inside the unit circle. Similarly let
B(θ) =
 [ θ1 I 0 . . . 0 θ2 0 I 0 . . 0 . . . . . . θq − 1 0 . . . 0 I θq 0 . . . 0 0 ]
qk × qk.
$B(θ)= [ θ1 I 0 . . . 0 θ2 0 I 0 . . 0 . . . . . . θq-1 0 . . . 0 I θq 0 . . . 0 0 ] qk×qk .$
Then the model is said to be invertible if the eigenvalues of B(θ)$B\left(\theta \right)$ lie inside the unit circle.
nag_tsa_uni_arma_roots (g13dx) returns the pk$pk$ eigenvalues of A(φ)$A\left(\varphi \right)$ (or the qk$qk$ eigenvalues of B(θ)$B\left(\theta \right)$) along with their moduli, in descending order of magnitude. Thus to check for stationarity or invertibility you should check whether the modulus of the largest eigenvalue is less than one.

## References

Wei W W S (1990) Time Series Analysis: Univariate and Multivariate Methods Addison–Wesley

## Parameters

### Compulsory Input Parameters

1:     k – int64int32nag_int scalar
k$k$, the dimension of the multivariate time series.
Constraint: k1${\mathbf{k}}\ge 1$.
2:     ip – int64int32nag_int scalar
The number of AR (or MA) parameter matrices, p$p$ (or q$q$).
Constraint: ip1${\mathbf{ip}}\ge 1$.
3:     par(ip × k × k${\mathbf{ip}}×{\mathbf{k}}×{\mathbf{k}}$) – double array
The AR (or MA) parameter matrices read in row by row in the order φ1,φ2,,φp${\varphi }_{1},{\varphi }_{2},\dots ,{\varphi }_{p}$ (or θ1,θ2,,θq${\theta }_{1},{\theta }_{2},\dots ,{\theta }_{q}$). That is, par((l1) × k × k + (i1) × k + j)${\mathbf{par}}\left(\left(\mathit{l}-1\right)×k×k+\left(i-1\right)×k+j\right)$ must be set equal to the (i,j)$\left(i,j\right)$th element of φl${\varphi }_{l}$, for l = 1,2,,p$\mathit{l}=1,2,\dots ,p$ (or the (i,j)$\left(i,j\right)$th element of θl${\theta }_{\mathit{l}}$, for l = 1,2,,q$\mathit{l}=1,2,\dots ,q$).

None.

work iwork

### Output Parameters

1:     rr(k × ip${\mathbf{k}}×{\mathbf{ip}}$) – double array
The real parts of the eigenvalues.
2:     ri(k × ip${\mathbf{k}}×{\mathbf{ip}}$) – double array
The imaginary parts of the eigenvalues.
3:     rmod(k × ip${\mathbf{k}}×{\mathbf{ip}}$) – double array
The moduli of the eigenvalues.
4:     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, k < 1${\mathbf{k}}<1$, or ip < 1${\mathbf{ip}}<1$.
ifail = 2${\mathbf{ifail}}=2$
An excessive number of iterations are needed to evaluate the eigenvalues of A(φ)$A\left(\varphi \right)$ (or B(θ)$B\left(\theta \right)$). This is an unlikely exit. All output parameters are undefined.

## Accuracy

The accuracy of the results depends on the original matrix and the multiplicity of the roots.

The time taken is approximately proportional to kp3$k{p}^{3}$ (or kq3$k{q}^{3}$).

## Example

```function nag_tsa_uni_arma_roots_example
k = int64(2);
ip = int64(1);
par = [0.802;
0.065;
0;
0.575];
[rr, ri, rmod, ifail] = nag_tsa_uni_arma_roots(k, ip, par)
```
```

rr =

0.8020
0.5750

ri =

0
0

rmod =

0.8020
0.5750

ifail =

0

```
```function g13dx_example
k = int64(2);
ip = int64(1);
par = [0.802;
0.065;
0;
0.575];
[rr, ri, rmod, ifail] = g13dx(k, ip, par)
```
```

rr =

0.8020
0.5750

ri =

0
0

rmod =

0.8020
0.5750

ifail =

0

```