%% Create and Adjust VAR Model Using Longhand Syntax
% This example shows how to create a three-dimensional VAR(4) model with unknown parameters using varm and the longhand 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. Specify that there are unknown coefficient matrices at lags 1 and 4 only.

numseries = 3;
p = 4;
ar = {nan(3) nan(3)};
lags = [1 p];
Mdl = varm('AR',ar,'Lags',lags)

% 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.
% You created the model without using response data. That is, Mdl is agnostic about data.
%
% Suppose that you want to add a linear time trend to the model to be estimated. By default, the linear time trend is zero. To make an unknown time trend present in the model, set the Trend property to a 3-by-1 vector of NaN values using dot notation.

Mdl.Trend = nan(3,1)

% Copyright 2012 The MathWorks, Inc.