smart_covmat function

Create random VAR model (dxd)(dxd) error term covariance matrix Ω\Omegafairly close to the given positive definite covariance matrix using (scaled) Wishart distribution

Create random VAR model (dxd)(dxd) error term covariance matrix Ω\Omega

fairly close to the given positive definite covariance matrix using (scaled) Wishart distribution

smart_covmat generates random VAR model (dxd)(dxd) error term covariance matrix Ω\Omega

from (scaled) Wishart distribution that is fairly close to the given matrix.

smart_covmat(d, Omega, accuracy)

Arguments

  • Omega: a symmetric positive definite (dxd)(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.

    The standard deviation of each diagonal element is...

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

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

Returns

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

  • Maintainer: Savi Virolainen
  • License: GPL-3
  • Last published: 2025-02-27