smart_covmat {gmvarkit} | R Documentation |
Create random VAR-model (dxd)
error term covariance matrix \Omega
fairly close to a given positive definite covariance matrix using (scaled)
Wishart distribution
Description
random_covmat
generates random VAR model (dxd)
error term covariance matrix \Omega
from (scaled) Wishart distribution that is fairly close to the given matrix.
Usage
smart_covmat(d, M, Omega, W_and_lambdas, accuracy, structural_pars = NULL)
Arguments
d |
the number of time series in the system. |
M |
|
Omega |
a symmetric positive definite |
W_and_lambdas |
the mean of the normal distribution the new parameters are generated from.
|
accuracy |
a positive real number adjusting how close to the given covariance matrix the returned individual should be. For reduced form models standard deviation of each diagonal element is for reduced form models
Wishart distribution is used for reduced form models, but for more details read the source code. For structural models, the parameters are generated from normal distribution with mean given
by the argument |
structural_pars |
If
See Virolainen (forthcoming) for the conditions required to identify the shocks and for the B-matrix as well (it is |
Value
- For reduced form models:
Returns a
(d(d+1)/2x1)
vector containing vech-vectorized covariance matrix\Omega
.- For structural models:
Returns a length
d^2 - n_zeros - d*(M - 1)
vector of the form(Wvec(W),\lambda_2,...,\lambda_M)
where\lambda_m=(\lambda_{m1},...,\lambda_{md})
contains the eigenvalue parameters of them
th regime(m>1)
andn_zeros
is the number of zero constraints inW
. If lambdas areC_lambda
constrained, replaced*(M - 1)
in the length withr
and\lambda_2,...,\lambda_M)
with\gamma
. Iffixed_lambdas
are used, the\lambda_{mi}
parameters are not included. The operatorWvec()
vectorizes a matrix and removes zeros.