unWvec: Reverse vectorization operator that restores zeros

View source: R/matcal.R

unWvecR Documentation

Reverse vectorization operator that restores zeros

Description

unWvec forms a square matrix from a vector of stacked columns where zeros are removed according to structural parameter constaints.

Usage

unWvec(Wvector, d, structural_pars = NULL)

Arguments

Wvector

a length d^2 - n_zeros vector where n_zeros is the number of zero entries in the matrix W.

d

the number of rows in the square matrix to be formed.

structural_pars

If NULL a reduced form model is considered. Reduced models can be used directly as recursively identified structural models. For a structural model identified by conditional heteroskedasticity, should be a list containing at least the first one of the following elements:

  • W - a (dxd) matrix with its entries imposing constraints on W: NA indicating that the element is unconstrained, a positive value indicating strict positive sign constraint, a negative value indicating strict negative sign constraint, and zero indicating that the element is constrained to zero.

  • C_lambda - a (d(M-1) x r) constraint matrix that satisfies (\lambda_{2},..., \lambda_{M}) = C_{\lambda} \gamma where \gamma is the new (r x 1) parameter subject to which the model is estimated (similarly to AR parameter constraints). The entries of C_lambda must be either positive or zero. Ignore (or set to NULL) if the eigenvalues \lambda_{mi} should not be constrained.

  • fixed_lambdas - a length d(M-1) numeric vector (\lambda_{2},..., \lambda_{M}) with elements strictly larger than zero specifying the fixed parameter values for the parameters \lambda_{mi} should be constrained to. This constraint is alternative C_lambda. Ignore (or set to NULL) if the eigenvalues \lambda_{mi} should not be constrained.

See Virolainen (forthcoming) for the conditions required to identify the shocks and for the B-matrix as well (it is W times a time-varying diagonal matrix with positive diagonal entries).

Value

a (d x d) matrix W.

Warning

No argument checks!


saviviro/gmvarkit documentation built on March 8, 2024, 4:15 a.m.