%% Create VAR(4) Model Template for Parameter Estimation
% Create a VAR(4) model for the consumer price index (CPI) and unemployment rate.
% Load the Data_USEconModel data set. Declare variables for the CPI (CPI) and unemployment rate (UNRATE) series.

load Data_USEconModel
cpi = DataTable.CPIAUCSL;
unrate = DataTable.UNRATE;

%
% Create a default VAR(4) model using the shorthand syntax.

Mdl = varm(2,4)

% Mdl is a varm model object. It serves as a template for model estimation. MATLAB® considers any NaN values as unknown parameter values to be estimated. For example, the Constant property is a 2-by-1 vector of NaN values. Therefore, model constants are active model parameters to be estimated.
%
% Include an unknown linear time trend term by setting the Trend property to NaN using dot notation.

Mdl.Trend = NaN

% MATLAB expands NaN to the appropriate length, that is, a 2-by-1 vector of NaN values.
% Copyright 2012 The MathWorks, Inc.