VAR2pcfilter: PAR representations of VAR models

View source: R/class_MF.R

VAR2pcfilterR Documentation

PAR representations of VAR models

Description

Give the univariate periodic autoregression representation of a VAR model. Several arrangements are supported as discussed by \insertCiteboshnakov2009gen;textualmcompanion. If the VAR model contains unit roots on the unit circle, then the univariate model is periodically integrated.

Usage

VAR2pcfilter(phi, ..., Sigma, Phi0, Phi0inv, D, what = "coef", perm)

Arguments

phi

VAR coefficients, a matrix, see Details.

...

alternative way to specify the VAR coefficients by giving a matrix for each lag in separate arguments, see section ‘Details’.

Sigma

covariance matrix of innovations.

Phi0

coefficient matrix at lag 0 (alternative to Sigma).

Phi0inv

inverse of Phi0 (alternative to Sigma and Phi0). If Phi0inv is lower triangular, then it is the Cholesky factor of Sigma (in Sigma{} = LDL').

D

the diagonal matrix corresponding to Phi0, not used if Sigma is specified.

what

what to return, a string. If equal to "coef", return the PAR coefficients only (as a matrix with one row for each “season”); if equal to "coef.and.var" return also the innovation variances. Otherwise return additional quantities (useful for exploration).

perm

a permutation specifying the ordering of the variables when treated as “seasons”. The default, d:1, corresponds to the U-form, see section ‘Details’.

Details

VAR2pcfilter converts a VAR model to a scalar periodic autoregressive (PAR) model. There are various ways to specify a VAR model and associate its variables with seasons of the scalar representation, see \insertCiteboshnakov2009gen;textualmcompanion for a detailed discussion and the terminology used here.

The VAR coefficients phi,... are those in the standard form of the VAR model \insertCite@e.g., see @boshnakov2009genmcompanion. There are two ways to specify them. The first is to put them side by side in a matrix [\Phi_1, \ldots, \Phi_p] and give this matrix as argument phi. Alternatively, the matrices \Phi_i may be given directly as arguments to VAR2pcfilter, as in VAR2pcfilter(Phi1, Phi2, Phi3, Sigma = Sigma).

The specification of the model can be completed by giving the covariance matrix, Sigma, of the innovations. Alternatively, it is possible to give the components of the UDU' decomposition of Sigma. In this case argument D is a vector giving the diagonal of the matrix D, while Phi0inv represents the upper triangular matrix U. A further option is to use argument Phi0 to specify the inverse of U. In summary, give either Sigma or D and one of Phi0inv and Phi0.

Phi0 can e interpreted as the coefficient at lag zero in the U-form \insertCiteboshnakov2009genmcompanion of the VAR model. diag(D) is the variance matrix of the innovations in that form. D also gives the variances of the innovations in the PAR (periodic autoregression) form.

By default, VAR2pcfilter constructs the U-form of the VAR model and extracts the coefficients of the PAR filter from it. This means that the variables in the multivariate vector are given “seasons” in reverse order (the first variable takes the last season, and so on). For the reasons behind this default, see \insertCiteboshnakov2009gen;textualmcompanion. Another arrangement can be chosen with the help of argument perm. perm should be a permutation specifying the desired allocation of variables to seasons. The default corresponds to perm=d:1, where d is the number of seasons. perm=1:d could be used to request the “natural” order.

When D and Phi0inv (or Phi0) are given, the matrix Sigma is not computed if argument perm is missing but it is if perm is present. This means that perm = d:1 may be used to force the formation of Sigma and recomputation of Phi0 and Phi0inv. This is redundant if the latter two are unit upper-triangular (which is assumed but not checked) but may be handy if, for example, the Cholesky decomposition with a lower triangular matrix is available.

Value

If what="coef", a matrix containing the periodic model coefficients (one row for each season).

If what="coef.and.var", a list containing the coefficients and the innovations' variances:

pcfilter

PAR coefficients, a matrix

var

innovation variances, a vector

Otherwise the returned list contains an additional component, Uform, which is itself a list with components:

Sigma

covariance matrix of innovations,

U0

coefficient for lag zero,

U

the remaining AR coefficients,

U0inv

the inverse of U0,

perm

permutation giving the season of each variable.

Note: U0 and U correspond to A0 and A in the reference (Boshnakov and Iqelan 2009).

Note

This function uses some non-exported internal functions:

.ldl

Computes the LDL' Cholesky decomposition with unit lower-triangular matrix L,

.udu

Computes the UDU' Cholesky decomposition with unit upper-triangular matrix U.

Could export these if they are deemed more widely useful.

Author(s)

Georgi N. Boshnakov

References

\insertRef

boshnakov2009genmcompanion

See Also

mf_VSform, sim_pcfilter

Examples

## create a pc filter
rfi <- sim_pcfilter(2,3)
rfi$pcfilter

## turn it into VAR form
flt <- new("MultiFilter", coef = rfi$pcfilter)
I1 <- mf_VSform(flt, form="I")
I1

## from VAR to scalar form
flt2 <- VAR2pcfilter(I1$Phi, Sigma = I1$Phi0inv %*% t(I1$Phi0inv))
flt2

## confirm that we are back to the original
##   (VAR2pcfilter doesn't drop redundant zeroes, so we do it manually)
    all.equal(flt2[ , 1:3], rfi$pcfilter) ## TRUE

mcompanion documentation built on Sept. 22, 2023, 5:12 p.m.