Learn R Programming

gmvarkit (version 1.1.1)

random_covmat: Create somewhat random VAR model error term covariance matrix

Description

random_covmat generates random VAR model \((dxd)\) error term covariance matrix \(\Omega\) from (scaled) Wishart distribution.

Usage

random_covmat(d, omega_scale)

Arguments

d

number of time series in the system.

omega_scale

a size \((dx1)\) strictly positive vector specifying the scale and variability of the random covariance matrices in random mutations. The covariance matrices are drawn from (scaled) Wishart distribution. Expected values of the random covariance matrices are diag(omega_scale). Standard deviations of the diagonal elements are sqrt(2/d)*omega_scale[i] and for non-diagonal elements they are sqrt(1/d*omega_scale[i]*omega_scale[j]). Note that for d>4 this scale may need to be chosen carefully. Default in GAfit is var(stats::ar(data[,i], order.max=10)$resid, na.rm=TRUE), i=1,...,d.

Value

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