Consider a VAR(2) model for the following seven macroeconomic series.
Gross domestic product (GDP)
GDP implicit price deflator
Paid compensation of employees
Nonfarm business sector hours of all persons
Effective federal funds rate
Personal consumption expenditures
Gross private domestic investment
Load the Data_USEconVECModel
data set.
For more information on the data set and variables, enter Description
at the command line.
Determine whether the data needs to be preprocessed by plotting the series on separate plots.
Stabilize all series, except the federal funds rate, by applying the log transform. Scale the resulting series by 100 so that all series are on the same scale.
Create a VAR(2) model using the shorthand syntax. Specify the variable names.
Mdl
is a varm
model object. All properties containing NaN
values correspond to parameters to be estimated given data.
Estimate the model using the entire data set and the default options.
EstMdl =
varm with properties:
Description: "AR-Stationary 7-Dimensional VAR(2) Model"
SeriesNames: "GDP" "GDPDEF" "COE" ... and 4 more
NumSeries: 7
P: 2
Constant: [15.835 9.91375 -14.0917 ... and 4 more]'
AR: {7×7 matrices} at lags [1 2]
Trend: [7×1 vector of zeros]
Beta: [7×0 matrix]
Covariance: [7×7 matrix]
EstMdl
is an estimated varm
model object. It is fully specified because all parameters have known values.
Convert the estimated VAR(2) model to its equivalent VEC(1) model representation.
VECMdl =
vecm with properties:
Description: "7-Dimensional Rank = 7 VEC(1) Model"
SeriesNames: "GDP" "GDPDEF" "COE" ... and 4 more
NumSeries: 7
Rank: 7
P: 2
Constant: [15.835 9.91375 -14.0917 ... and 4 more]'
Adjustment: [7×7 matrix]
Cointegration: [7×7 diagonal matrix]
Impact: [7×7 matrix]
CointegrationConstant: [7×1 vector of NaNs]
CointegrationTrend: [7×1 vector of NaNs]
ShortRun: {7×7 matrix} at lag [1]
Trend: [7×1 vector of zeros]
Beta: [7×0 matrix]
Covariance: [7×7 matrix]
VECMdl
is a vecm
model object.