Learn R Programming

BGVAR (version 2.0.1)

gfevd.decomp: Generalized Forecast Error Variance Decomposition

Description

This function calculates a complete generalized forecast error variance decomposition (GFEVDs) based on generalized impulse response functions akin to Lanne-Nyberg (2016). The Lanne-Nyberg (2016) corrected GFEVD sum up to unity.

Usage

gfevd.decomp(obj, nhor=24, running=TRUE, multithread=FALSE, verbose=TRUE)

Arguments

obj

an object of class bgvar.

nhor

the forecast horizon.

running

Default is set to TRUE and implies that only a running mean over the posterior draws is calculated. A full analysis including posterior bounds is likely to cause memory issues.

multithread

If set to TRUE parallel computing using the packages foreach and doParallel. Number of cores is set to maximum number of cores in the computer. This option is recommended when working with sign restrictions to speed up computations. Default is set to FALSE and thus no parallelization.

verbose

If set to FALSE it suppresses printing messages to the console.

Value

Returns a list with two elements

  • GFEVD a three or four-dimensional array, with the first dimension referring to the K time series that are decomposed into contributions of K time series (second dimension) for nhor forecast horizons. In case running=TRUE only the posterior mean else also its 16% and 84% credible intervals is contained in the fourth dimension.

  • xglobal used data of the model.

References

Lanne, M. and H. Nyberg (2016) Generalized Forecast Error Variance Decomposition for Linear and Nonlinear Multivariate Models. Oxford Bulletin of Economics and Statistics, Vol. 78(4), pp. 595-603.

See Also

bgvar.

Examples

Run this code
# NOT RUN {
library(BGVAR)
data(eerData)
model.ssvs.eer<-bgvar(Data=eerData,W=W.trade0012,saves=100,burns=100,plag=1,
                      prior="SSVS",thin=1,eigen=TRUE)
                      
# Calculates running mean GFEVDs for all variables in the system 
GFEVD<-gfevd.decomp(model.ssvs.eer,nhor=24,running=TRUE)
# }

Run the code above in your browser using DataLab