Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

fevd

Forecast Error Variance Decomposition


Description

Produces the forecast error variance decomposition of a Bayesian VAR model.

A plot function for objects of class "bvarfevd".

Usage

fevd(object, response = NULL, n.ahead = 5, type = "oir", normalise_gir = FALSE)

## S3 method for class 'bvarfevd'
plot(x, ...)

Arguments

object

an object of class "bvar", usually, a result of a call to bvar or bvec_to_bvar.

response

name of the response variable.

n.ahead

number of steps ahead.

type

type of the impulse responses used to calculate forecast error variable decompositions. Possible choices are orthogonalised oir (default) and generalised gir impulse responses.

normalise_gir

logical. Should the GIR-based FEVD be normalised?

x

an object of class "bvarfevd", usually, a result of a call to fevd.

...

further graphical parameters.

Details

The function produces forecast error variance decompositions (FEVD) for the VAR model

A_0 y_t = ∑_{i = 1}^{p} A_{i} y_{t-i} + u_t,

with u_t \sim N(0, Σ). 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

ω^{OIR}_{jk, h} = \frac{∑_{i = 0}^{h-1} (e_j^{\prime} Φ_i P e_k )^2}{∑_{i = 0}^{h-1} (e_j^{\prime} Φ_i Σ Φ_i^{\prime} e_j )},

where Φ_i is the forecast error impulse response for the ith period, P is the lower triangular Choleski decomposition of the variance-covariance matrix Σ, 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

ω^{SIR}_{jk, h} = \frac{∑_{i = 0}^{h-1} (e_j^{\prime} Φ_i A_0^{-1} e_k )^2}{∑_{i = 0}^{h-1} (e_j^{\prime} Φ_i A_0^{-1} A_0^{-1\prime} Φ_i^{\prime} e_j )},

where σ_{jj} is the diagonal element of the jth variable of the variance covariance matrix.

If type = "gir", the generalised FEVD will be calculated as

ω^{GIR}_{jk, h} = \frac{σ^{-1}_{jj} ∑_{i = 0}^{h-1} (e_j^{\prime} Φ_i Σ e_k )^2}{∑_{i = 0}^{h-1} (e_j^{\prime} Φ_i Σ Φ_i^{\prime} e_j )},

where σ_{jj} is the diagonal element of the jth variable of the variance covariance matrix.

If type = "sgir", the structural generalised FEVD will be calculated as

ω^{SGIR}_{jk, h} = \frac{σ^{-1}_{jj} ∑_{i = 0}^{h-1} (e_j^{\prime} Φ_i A_0^{-1} Σ e_k )^2}{∑_{i = 0}^{h-1} (e_j^{\prime} Φ_i A_0^{-1} Σ A_0^{-1\prime} Φ_i^{\prime} e_j )}

.

Since GIR-based FEVDs do not add up to unity, they can be normalised by setting normalise_gir = TRUE.

Value

A time-series object of class "bvarfevd".

References

Lütkepohl, H. (2006). New introduction to multiple time series analysis (2nd ed.). Berlin: Springer.

Pesaran, H. H., & Shin, Y. (1998). Generalized impulse response analysis in linear multivariate models. Economics Letters, 58, 17-29.

Examples

# Load data
data("e1")
e1 <- diff(log(e1)) * 100

# Generate models
model <- gen_var(e1, p = 2, deterministic = 2,
                 iterations = 100, burnin = 10)

# Add priors
model <- add_priors(model)

# Obtain posterior draws
object <- draw_posterior(model)

# Obtain FEVD
vd <- fevd(object, response = "cons")

# Plot FEVD
plot(vd)


# Load data
data("e1")
e1 <- diff(log(e1)) * 100

# Generate model data
model <- gen_var(e1, p = 2, deterministic = 2,
                 iterations = 100, burnin = 10)
# Chosen number of iterations and burnin should be much higher.

# Add prior specifications
model <- add_priors(model)

# Obtain posterior draws
object <- draw_posterior(model)

# Obtain FEVD
vd <- fevd(object, response = "cons")

# Plot
plot(vd)

bvartools

Bayesian Inference of Vector Autoregressive Models

v0.2.0
GPL (>= 2)
Authors
Franz X. Mohr [aut, cre]
Initial release
2021-04-25

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.