Learn R Programming

mvgam (version 1.1.51)

fevd.mvgam: Calculate latent VAR forecast error variance decompositions

Description

Compute forecast error variance decompositions from mvgam models with Vector Autoregressive dynamics

Usage

fevd(object, ...)

# S3 method for mvgam fevd(object, h = 10, ...)

Value

An object of class mvgam_fevd containing the posterior forecast error variance decompositions. This object can be used with the supplied S3 functions plot

Arguments

object

list object of class mvgam resulting from a call to mvgam() that used a Vector Autoregressive latent process model (either as VAR(cor = FALSE) or VAR(cor = TRUE))

...

ignored

h

Positive integer specifying the forecast horizon over which to calculate the IRF

Author

Nicholas J Clark

Details

A forecast error variance decomposition is useful for quantifying the amount of information each series that in a Vector Autoregression contributes to the forecast distributions of the other series in the autoregression. This function calculates the forecast error variance decomposition using the orthogonalised impulse response coefficient matrices \(\Psi_h\), which can be used to quantify the contribution of series \(j\) to the h-step forecast error variance of series \(k\): $$ \sigma_k^2(h) = \sum_{j=1}^K(\psi_{kj, 0}^2 + \ldots + \psi_{kj, h-1}^2) \quad $$ If the orthogonalised impulse reponses \((\psi_{kj, 0}^2 + \ldots + \psi_{kj, h-1}^2)\) are divided by the variance of the forecast error \(\sigma_k^2(h)\), this yields an interpretable percentage representing how much of the forecast error variance for \(k\) can be explained by an exogenous shock to \(j\).

References

Lütkepohl, H (2006). New Introduction to Multiple Time Series Analysis. Springer, New York.

See Also

VAR, irf, stability

Examples

Run this code
# \donttest{
# Simulate some time series that follow a latent VAR(1) process
simdat <- sim_mvgam(
  family = gaussian(),
  n_series = 4,
  trend_model = VAR(cor = TRUE),
  prop_trend = 1
)
plot_mvgam_series(data = simdat$data_train, series = "all")

# Fit a model that uses a latent VAR(1)
mod <- mvgam(y ~ -1,
  trend_formula = ~1,
  trend_model = VAR(cor = TRUE),
  family = gaussian(),
  data = simdat$data_train,
  chains = 2,
  silent = 2
)

# Calulate forecast error variance decompositions for each series
fevds <- fevd(mod, h = 12)

# Plot median contributions to forecast error variance
plot(fevds)

# View a summary of the error variance decompositions
summary(fevds)
# }

Run the code above in your browser using DataLab