%% Create and Adjust VAR Model Using Shorthand Syntax
% This example shows how to create a three-dimensional VAR(4) model with unknown parameters using varm and the shorthand syntax. Then, this example shows how to adjust parameters of the created model using dot notation.
% Create a VAR(4) model for a three-dimensional response series using the shorthand syntax.

numseries = 3;
p = 4;
Mdl = varm(3,4)

% Mdl is a varm model object. The properties of the model display at the command line. Observe that:
% The default value of some of the parameters are NaN values, which indicates their presence in the model. In particular, each lag from 1 through 4 has an unknown, nonzero autoregressive coefficient matrix.
% You created the model without using response data. That is, Mdl is agnostic about data.
%
% Suppose that you want lags 1 and 4 in the model to be unknown and nonzero, but all other lags are zero. Using dot notation, remove the other lags from the model object by placing 3-by-3 matrices of zeros the corresponding cells.

Mdl.AR{2} = zeros(3);
Mdl.AR{3} = zeros(3)

% Observe that the model degree p is still 4, but there are unknown, nonzero coefficients at lags 1 and 4 only.
% Copyright 2012 The MathWorks, Inc.