Learn R Programming

gmvarkit (version 1.1.1)

smart_covmat: Create somewhat 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, Omega, accuracy)

Arguments

d

number of time series in the system.

Omega

a symmetric positive definite \((dxd)\) covariance matrix specifying expected value of the matrix to be generated.

accuracy

a positive real number adjusting how close to the given covariance matrix the returned individual should be. Standard deviation of each diagonal element is

  • \(\omega_{i,i}/\)accuracy when accuracy > d/2

  • and sqrt(2/d)*\(\omega_{i,i}\) when accuracy <= d/2.

Wishart distribution is used, but for more details read the source code.

Value

Returns \((d(d+1)/2x1)\) vector containing vech-vectorized covariance matrix \(\Omega\).