vgxplot

Plot VARMAX model responses

Synopsis

vgxplot(Spec,Y)

vgxplot(Spec,Y,FY)

vgxplot(Spec,Y,FY,FYCov)

Description

vgxplot plots a multivariate time series process with optional error bands.

Required Input Arguments

Spec

A multivariate time series specification structure for an n-dimensional VARMA time series process, as created by vgxset.

Y

nPY observed paths of an n-dimensional time series process with T observations for each path, collected in a T-by-n-by-nPY array. Times are ordered by row from oldest to most recent. Plotted error bands are plus or minus one standard deviation of the one-period prediction error derived from Spec.

Optional Input Arguments

FY

nPFY forecast paths of an n-dimensional time series process with FT observations for each path, collected in a FT-by-n-by-nPFY array. Times are ordered by row from oldest to most recent. Plotted error bands are plus or minus one standard deviation of the cumulative forecast error derived from FYCov.

FYCov

A single path of forecast error covariances for an n-dimensional time series process with FT observations. FYCov is stored as an FT-cell vector with n-by-n forecast error covariance matrices in each cell for FT times. FYCov is the same if the underlying time series process has multiple paths, so only one path is necessary. Although multiple time series paths can be plotted, FYCov is based on calibration of a single path of the time series process. Plots with multiple forecast paths are displayed with error bands derived from FYCov that may not be valid for all paths. Nonetheless, the error bands enclose the envelope of multiple paths.

Examples

Forecast and Plot a Vector Autoregressive Process

Start with a 2-dimensional VARMA(2, 2) specification structure in Spec and time series data in Y:

load Data_VARMA22

Propagate the time series forward 5 periods in FY and the forecast error covariance in FYCov:

[FY, FYCov] = vgxpred(Spec, 5, [], Y);

Plot just the times series process with 1-step prediction error bands:

vgxplot(Spec, Y);

Plot just the forecast time series process with t-step prediction error bands:

vgxplot(Spec, [], FY, FYCov);

Plot both the time series process and its forecast with prediction errors (here the plot just displays the last 10 samples of the times series data):

vgxplot(Spec, Y(end-9:end,:), FY, FYCov);

Was this topic helpful?