The function produces forecast error variance decompositions (FEVD) for the VAR model
$$A_0 y_t = \sum_{i = 1}^{p} A_{i} y_{t-i} + u_t,$$
with \(u_t \sim N(0, \Sigma)\). For non-structural models matrix \(A_0\) is set to the identiy matrix
and can therefore be omitted, where not relevant.
If the FEVD is based on the orthogonalised impulse resonse (OIR), the FEVD will be calculated as
$$\omega^{OIR}_{jk, h} = \frac{\sum_{i = 0}^{h-1} (e_j^{\prime} \Phi_i P e_k )^2}{\sum_{i = 0}^{h-1} (e_j^{\prime} \Phi_i \Sigma \Phi_i^{\prime} e_j )},$$
where \(\Phi_i\) is the forecast error impulse response for the \(i\)th period,
\(P\) is the lower triangular Choleski decomposition of the variance-covariance
matrix \(\Sigma\), \(e_j\) is a selection vector for the response variable and
\(e_k\) a selection vector for the impulse variable.
If type = "sir"
, the structural FEVD will be
calculated as $$\omega^{SIR}_{jk, h} = \frac{\sum_{i = 0}^{h-1} (e_j^{\prime} \Phi_i A_0^{-1} e_k )^2}{\sum_{i = 0}^{h-1} (e_j^{\prime} \Phi_i A_0^{-1} A_0^{-1\prime} \Phi_i^{\prime} e_j )},$$
where \(\sigma_{jj}\) is the diagonal element of the \(j\)th variable of the variance covariance matrix.
If type = "gir"
, the generalised FEVD will be
calculated as $$\omega^{GIR}_{jk, h} = \frac{\sigma^{-1}_{jj} \sum_{i = 0}^{h-1} (e_j^{\prime} \Phi_i \Sigma e_k )^2}{\sum_{i = 0}^{h-1} (e_j^{\prime} \Phi_i \Sigma \Phi_i^{\prime} e_j )},$$
where \(\sigma_{jj}\) is the diagonal element of the \(j\)th variable of the variance covariance matrix.
If type = "sgir"
, the structural generalised FEVD will be
calculated as $$\omega^{SGIR}_{jk, h} = \frac{\sigma^{-1}_{jj} \sum_{i = 0}^{h-1} (e_j^{\prime} \Phi_i A_0^{-1} \Sigma e_k )^2}{\sum_{i = 0}^{h-1} (e_j^{\prime} \Phi_i A_0^{-1} \Sigma A_0^{-1\prime} \Phi_i^{\prime} e_j )}$$.
Since GIR-based FEVDs do not add up to unity, they can be normalised by setting normalise_gir = TRUE
.