Learn R Programming

sstvars (version 1.1.0)

random_impactmat: Create random VAR model impact matrix

Description

random_impactmat generates random VAR model \((dxd)\) impact matrix \(B\) with its elements drawn from specific normal distributions (see the source code). If not the first regime, will create the matrix \(B_m*\).

Usage

random_impactmat(d, B_scale, is_regime1 = TRUE)

Value

Returns a \((d^2 \times 1)\) vector containing the vectorized impact matrix \(B\).

Arguments

B_scale

a size \((d \times 1)\) strictly positive vector specifying the mean and variability of the random impact matrices in random mutations. In Regime 1, the mean of the error term covariance matrix implied by the random impact matrix will be 0.95*diag(B_scale) and in the rest of the regimes diag(B_scale), whereas the variability increases with B_scale. Default in GAfit is var(stats::ar(data[,i], order.max=10)$resid, na.rm=TRUE), i=1,...,d. This argument is ignored if cond_dist != "ind_Student".

is_regime1

is the impact matrix for Regime 1? Regime 1 impact matrix is constrained so the elements in its first row are in a decreasing ordering and the diagonal elements are strictly positive.

Details

If the impact matrix is not for Regime 1, will create the matrix \(B_m*\), which is related to the impact matrix \(B_m\) of Regime m as \(B_m* = B_m - B_1\).