1. Home
2. TVARMA procedure

# TVARMA procedure

Fits a vector autoregressive moving average (VARMA) model (A.I. Glaser).

### Options

PRINT = string tokens What to print (model, summary, estimates, correlations); default mode, summ, esti Method of likelihood calculation (exact, conditional); default exac How to treat the constant (estimate, fixtozero); default esti Variate of length two, containing the number of AR and MA parameters respectively Specifies fixed values of the AR parameters Specifies fixed values of the MA parameters Specifies fixed values of the constant parameters Specifies the order of differencing for each series; default 0 Number of residual cross-correlation matrices to be computed for calculating the modified portmanteau statistic; default 20 Maximum number of iterations; if this is not set, an appropriate default is determined automatically according to the number of parameters Convergence criterion; default 0.0001

### Parameters

SERIES = pointers Time series to be modelled (output series) Saves the residual series Saves estimates of parameters for each SERIES variate Saves standard errors of the estimates Variance-covariance matrix of the residuals Saves the residual sum of squares or deviance Saves the correlation matrix of the estimates Saves the first derivative of the loglikelihood function Saves information for use with TVGRAPH or TVFORECAST

### Description

TVARMA fits parameters to vector autoregressive moving average (VARMA) time series models. These are natural extensions of the ordinary ARMA models, with the generalization that there may be correlations between as well as within the series.

If Xt = (x1t, x2txkt)′ denotes a vector of k time series for times t = 1…n, then a VARMA(pq) model can be written as

Xt – μ = φ1 (Xt-1 – μ) + φ2 (Xt-2 – μ) + … + φp (Xt-p – μ) + εt + θ1 εt-1 + θ2 εt-2

+ … + θq εtq

where εt = (ε1t, ε2t, … εkt)′, for t = 1…n is a vector of k residual series, assumed to be Normally distributed with zero mean and variance-covariance matrix Σ. Each AR parameter (φ) and MA parameter (θ) is a k × k matrix.

The SERIES parameter lists the variates to which the model is to be fitted. The VARMA model is selected by setting the ARMA option to a variate of length two which contains the number of AR and MA parameters in the model (p and q as noted above). By default, the vector of constants of the k time series is estimated, but they can be fixed at zero by setting option CONSTANT=fixtozero.

The LIKELIHOOD option specifies the criterion that is used to calculate the estimates of the parameters. The default setting, exact, calculates the maximum of the log-likelihood subject to stationarity and invertibility constraints. The alternative setting, conditional, calculates conditional maximum likelihood estimates. This may be useful when the parameter estimates are close to the boundary of the invertibility region.

Printed output is controlled by the PRINT option with settings:

    model brief description of the model, including identifiers and model order; brief summary of the model, including the log-likelihood; parameter estimates and their standard errors; and correlations between the parameter estimates of the model.

The AR, MA and constant parameters can be fixed to values supplied by the ARFIXED, MAFIXED and MUFIXED options respectively. The options ARFIXED and MAFIXED should supply a pointer to matrices of size k × k, where k is the number of time series being analysed. The matrices contain the fixed values, with the row and column index indicating which element(s) of the parameter are to be kept fixed, and the pointer suffix indicates in which parameter. For an analysis of four time series (k = 4), with p = 3 and q = 1, the example below sets the value in the first row and second column of the third AR parameter to zero, and the value in the fourth row and second column of the first MA parameter to 0.5.

MATRIX [ROWS=4; COLUMNS=4] arf

MATRIX [ROWS=4; COLUMNS=4] maf

CALC arf\$[1;2] = 0

CALC maf\$[4;2] = 0.5

POINTER [NVALUES=4] arset, maset

CALC arset[3] = arf

CALC maset[1] = maf

To set the constant parameters to a fixed value, you should set MUFIXED to a variate of length k, where element i sets the value of the parameter vi in the mean vector.

The NDIFFERENCING option can be used if the time series being investigated are not stationary, and need to be differenced. It should be set to a variate with an element for each series, indicating the amount of differencing required. This is a variate since it may not be optimal to difference each component of Xt in the same way; see Chatfield (2004) Section 12.4.

Results from the analysis can be saved by using the parameters RESIDUALS, ESTIMATES, SEESTIMATES, VCRESIDUALS, DEVIANCE, CORRELATIONS, GRADIENTS and SAVE. The ESTIMATES and their associated SEESTIMATES are stored in pointers to tables: the first table in the pointer contains the values of v, the next p tables contain the AR parameters, and the final q tables contain the MA parameters.

Options: PRINT, LIKELIHOOD, CONSTANT, ARMA, ARFIXED, MAFIXED, MUFIXED, NDIFFERENCING, NCROSSRESIDUAL, MAXCYCLE, TOLERANCE.

Parameters: SERIES, RESIDUALS, ESTIMATES, SEESTIMATES, VCRESIDUALS, DEVIANCE, CORRELATIONS, GRADIENTS, SAVE.

### Action with RESTRICT

The SERIES variates must not be restricted.

### Method

TVARMA uses the NAG directive to call routine G13DDF for model fitting, G13DLF for differencing and G13DSF for diagnostic checking.

### Reference

Chatfield, C. (2004). The Analysis of Time series, an Introduction (6th edition). Chapman and Hall, London.

Procedures: TVFORECAST, TVGRAPH.

Commands for: Time series.

### Example

CAPTION   'TVARMA example',\
'NAG example for G13DCF, D13DJF and G13DSF.'; STYLE=meta,plain
VARIATE   [NVALUES=48] C1
-1.49 -1.62 5.2 6.23 6.21 5.86 4.09 3.18 2.62 1.49 1.17 0.85 -0.35 0.24 2.44
2.58 2.04 0.4 2.26 3.34 5.09 5 4.78 4.11 3.45 1.65 1.29 4.09 6.32 7.5 3.89
1.58 5.21 5.25 4.93 7.38 5.87 5.81 9.68 9.07 7.29 7.84 7.55 7.32 7.97 7.76 7
8.35 :
VARIATE   [NVALUES=48] C2
7.34 6.35 6.96 8.54 6.62 4.97 4.55 4.81 4.75 4.76 10.88 10.01 11.62 10.36
6.4 6.24 7.93 4.04 3.73 5.6 5.35 6.81 8.27 7.68 6.65 6.08 10.25 9.14 17.75
13.3 9.63 6.8 4.08 5.06 4.94 6.65 7.94 10.76 11.89 5.85 9.01 7.5 10.02 10.38
8.15 8.37 10.73 12.14 :

" Set values of fixed AR parameters "
MATRIX    [ROWS=2; COLUMNS=2] armatrix
CALCULATE armatrix\$[2;1] = 0
POINTER   [NVALUES=4] arset
CALCULATE arset[1] = armatrix

TVARMA     [ARMA=!(1,0); ARFIXED=arset; NCROSS=10] !P(C1,C2)
TVGRAPH