fevd.decomp {BGVAR}R Documentation

Forecast error variance decomposition (FEVD)

Description

This function calculates forecast error variance decompositions (FEVDs) for cholesky and sign restriction identified shocks. Since the calculations are very time consuming, the FEVDs are based on the posterior median only (as opposed to calculating FEVDs for each MCMC draw). In case the underlying shock has been identified via sign restrictions, the rotation matrix corresponds to the one that fulfills the sign restrictions at the posterior median of the estimated coefficients. More precisely, the algorithm searches for 50 rotation matrices that fulfill the sign restrictions at the posterior median of the coefficients and then singles out the rotation matrix tha minimizes the distance to the median of the impulse responses as suggested in Frey and Pagan 2011.

Usage

fevd.decomp(irf.obj,R=NULL,var.slct=NULL)

Arguments

irf.obj

An item fitted with IRF

R

If NULL and the irf.obj has been fitted via sign restrictions, the rotation matrix is used that minimizes the distance to the median impulse responses at the posterior median, as described above.

var.slct

A character vector that contains the variables for which forecast error variance decompositions should be performed. If NULL the FEVD is computed for the whole system, which is very time-consuming.

Value

FEVD

is a three-dimensional array, with the first dimension referring to the K time series, the second to the forecast horizon and the third dimension refers to the variables for which the forecasts errors are decomposed.

Author(s)

Martin Feldkircher and Florian Huber

Examples

library(BGVAR)
data(eerData)
model.ssvs.eer<-bgvar(Data=eer.data,W=W.trade0012,saves=100,burns=100,plag=1,Cpu=1,prior="SSVS",save_thin=1,eigen=TRUE, trim=1.05)

# US monetary policy shock
shocks<-list();shocks$shock="stir";shocks$ccode<-"US";shocks$ident="chol";shocks$scal=-100
irf.chol.us.mp<-IRF(gvar.obj=model.ssvs.eer,shockc=shocks,nhor=48)

# calculates FEVD for variables US.Dp and EA.y
fevd.us.mp=fevd.decomp(irf.obj=irf.chol.us.mp,var.slct=c("US.Dp","EA.y"))


# NOT RUN - calculates FEVDs for all variables in the system, very time consuming
#fevd.us.mp=fevd.decomp(irf.obj=irf.chol.us.mp,var.slct=NULL)

[Package BGVAR version 1.1.3 Index]