# fevd

Generate vector error-correction (VEC) model forecast error variance decomposition (FEVD)

*Since R2019a*

## Syntax

## Description

The `fevd`

function returns the forecast error
decomposition (FEVD) of the variables in a VEC(*p* – 1)
model attributable to shocks to each response variable in the system. A fully
specified `vecm`

model object
characterizes the VEC model.

The FEVD provides information about the relative importance of each innovation in
affecting the forecast error variance of all response variables in the system. In contrast,
the impulse response function (IRF) traces the effects of an innovation shock to one variable
on the response of all variables in the system. To estimate the IRF of a VEC model
characterized by a `vecm`

model object, see `irf`

.

You can supply optional data, such as a presample, as a numeric array, table, or
timetable. However, all specified input data must be the same data type. When the input model
is estimated (returned by `estimate`

), supply
the same data type as the data used to estimate the model. The data type of the outputs
matches the data type of the specified input data.

returns a numeric array containing the orthogonalized FEVDs of the response variables that
compose the VEC(`Decomposition`

= fevd(`Mdl`

)*p* – 1) model `Mdl`

characterized by a
fully specified `vecm`

model object.
`fevd`

shocks variables at time 0, and returns the FEVD for
times 1 through 20.

If `Mdl`

is an estimated model (returned by `estimate`

) fit to
a numeric matrix of input response data, this syntax applies.

uses additional options specified by one or more name-value arguments.
`Decomposition`

= fevd(`Mdl`

,`Name=Value`

)`fevd`

returns numeric arrays when all optional input data are
numeric arrays. For example, `fevd(Mdl,NumObs=10,Method="generalized")`

specifies estimating a generalized FEVD for periods 1 through 10.

If `Mdl`

is an estimated model fit to a numeric matrix of input
response data, this syntax applies.

`[`

returns numeric arrays of lower `Decomposition`

,`Lower`

,`Upper`

] = fevd(___)`Lower`

and upper
`Upper`

95% confidence bounds for confidence intervals on the true
FEVD, for each period and variable in the FEVD, using any input argument combination in
the previous syntaxes. By default, `fevd`

estimates confidence
bounds by conducting Monte Carlo simulation.

If `Mdl`

is an estimated model fit to a numeric matrix of input
response data, this syntax applies.

If `Mdl`

is a custom `vecm`

model object
(an object not returned by `estimate`

or
modified after estimation), `fevd`

can require a sample size for
the simulation `SampleSize`

or presample responses
`Y0`

.

returns the table
or timetable `Tbl`

= fevd(___)`Tbl`

containing the FEVDs and, optionally, corresponding
95% confidence bounds, of the response variables that compose the VEC(*p*
– 1) model `Mdl`

. The FEVD of the corresponding response is a variable in
`Tbl`

containing a matrix with columns corresponding to the variables
in the system shocked at time 0.* (since R2022b)*

If you set at least one name-value argument that controls the 95% confidence bounds on
the FEVD, `Tbl`

also contains a variable for each of the lower and
upper bounds. For example, `Tbl`

contains confidence bounds when you
set the `NumPaths`

name-value argument.

If `Mdl`

is an estimated model fit to a table or timetable of input
response data, this syntax applies.

## Examples

## Input Arguments

## Output Arguments

## More About

## Algorithms

If

`Method`

is`"orthogonalized"`

, then`fevd`

orthogonalizes the innovation shocks by applying the Cholesky factorization of the model covariance matrix`Mdl.Covariance`

. The covariance of the orthogonalized innovation shocks is the identity matrix, and the FEVD of each variable sums to one, that is, the sum along any row of`Decomposition`

or rows associated with FEVD variables in`Tbl`

is one. Therefore, the orthogonalized FEVD represents the proportion of forecast error variance attributable to various shocks in the system. However, the orthogonalized FEVD generally depends on the order of the variables.If

`Method`

is`"generalized"`

, then the resulting FEVD, then the resulting FEVD is invariant to the order of the variables, and is not based on an orthogonal transformation. Also, the resulting FEVD sums to one for a particular variable only when`Mdl.Covariance`

is diagonal[5]. Therefore, the generalized FEVD represents the contribution to the forecast error variance of equation-wise shocks to the response variables in the model.If

`Mdl.Covariance`

is a diagonal matrix, then the resulting generalized and orthogonalized FEVDs are identical. Otherwise, the resulting generalized and orthogonalized FEVDs are identical only when the first variable in`Mdl.SeriesNames`

shocks all variables (for example, all else being the same, both methods yield the same value of`Decomposition(:,1,:)`

).The predictor data in

`X`

or`InSample`

represents a single path of exogenous multivariate time series. If you specify`X`

or`InSample`

and the model`Mdl`

has a regression component (`Mdl.Beta`

is not an empty array),`fevd`

applies the same exogenous data to all paths used for confidence interval estimation.`fevd`

conducts a simulation to estimate the confidence bounds`Lower`

and`Upper`

or associated variables in`Tbl`

.If you do not specify residuals by supplying

`E`

or using`InSample`

,`fevd`

conducts a Monte Carlo simulation by following this procedure:Simulate

`NumPaths`

response paths of length`SampleSize`

from`Mdl`

.Fit

`NumPaths`

models that have the same structure as`Mdl`

to the simulated response paths. If`Mdl`

contains a regression component and you specify predictor data by supplying`X`

or using`InSample`

,`fevd`

fits the`NumPaths`

models to the simulated response paths and the same predictor data (the same predictor data applies to all paths).Estimate

`NumPaths`

FEVDs from the`NumPaths`

estimated models.For each time point

*t*= 0,…,`NumObs`

, estimate the confidence intervals by computing 1 –`Confidence`

and`Confidence`

quantiles (the upper and lower bounds, respectively).

Otherwise,

`fevd`

conducts a nonparametric bootstrap by following this procedure:Resample, with replacement,

`SampleSize`

residuals from`E`

or`InSample`

. Perform this step`NumPaths`

times to obtain`NumPaths`

paths.Center each path of bootstrapped residuals.

Filter each path of centered, bootstrapped residuals through

`Mdl`

to obtain`NumPaths`

bootstrapped response paths of length`SampleSize`

.Complete steps 2 through 4 of the Monte Carlo simulation, but replace the simulated response paths with the bootstrapped response paths.

## References

[1]
Hamilton, James D. *Time Series Analysis*. Princeton, NJ: Princeton University Press, 1994.

[2]
Johansen, S. *Likelihood-Based Inference in Cointegrated Vector Autoregressive Models*. Oxford: Oxford University Press, 1995.

[3]
Juselius, K. *The Cointegrated VAR Model*. Oxford: Oxford University Press, 2006.

[4]
Lütkepohl, Helmut. *New Introduction to Multiple Time Series Analysis*. New York, NY: Springer-Verlag, 2007.

[5]
Pesaran, H. H., and Y. Shin. "Generalized Impulse Response
Analysis in Linear Multivariate Models." *Economic Letters.* Vol. 58, 1998,
pp. 17–29.

## Version History

**Introduced in R2019a**