Accelerating the pace of engineering and science

# vgxcount

Count VARMAX model parameters

## Synopsis

NumParam = vgxcount(Spec)

[NumParam,NumActive] = vgxcount(Spec)

## Description

vgxcount counts the total and active parameters in a multivariate time series model.

The total number of parameters in a multivariate time series model includes all parameters in the conditional mean and conditional covariance models. If the innovations process has a full covariance, the total number of parameters is

$n+nAR\cdot {n}^{2}+nMA\cdot {n}^{2}+nX+n\left(n+1\right)/2$

where n is the number of time series, nAR is the number of autoregressive lag matrices, nMA is the number of moving average lag matrices, and nX is the number of exogenous parameters. If the innovations process has a diagonal covariance, the total number of parameters is

$n+nAR\cdot {n}^{2}+nMA\cdot {n}^{2}+nX+n$

If the model does not have a constant (if Spec.Constant is false), then the total is reduced by n.

 Note:   The innovations covariance matrix is a symmetric matrix with at most n(n + 1)/2 unique elements.

## Input Arguments

 Spec A multivariate time series specification structure for an n-dimensional time series process, as created by vgxset.

## Output Arguments

 NumParam Total number of parameters in current model. NumActive Number of active (unrestricted) parameters in current model.

## Examples

expand all

### Count VAR Model Parameters

Start with a 2-dimensional VARMA(2, 2) specification structure in Spec:

```load Data_VARMA22
```

Change the model to estimate only the diagonals of the AR matrices and count the total number of parameters in NumParam and the number of unrestricted parameters in NumActive:

```Spec = vgxset(Spec,'ARsolve',{logical(eye(2)),logical(eye(2))});

[NumParam, NumActive] = vgxcount(Spec)
```
```NumParam =

19

NumActive =

15

```