%% Specify All Parameter Values of VEC Model
% Consider this VEC(1) model for three hypothetical response series.
% \begin{array}{rcl}
% \Delta {y_t} &=& c + AB^\prime {y_{t - 1}} + {\Phi _1}\Delta {y_{t - 1}} + {\varepsilon _t}\\
%  & & \\
%  &=& \left[ {\begin{array}{*{20}{c}}
% { - 1}\\
% { - 3}\\
% { - 30}
% \end{array}} \right] + \left[ {\begin{array}{*{20}{c}}
% { - 0.3}&{0.3}\\
% { - 0.2}&{0.1}\\
% { - 1}&0
% \end{array}} \right]\left[ {\begin{array}{*{20}{c}}
% {0.1}&{ - 0.2}&{0.2}\\
% { - 0.7}&{0.5}&{0.2}
% \end{array}} \right]{y_{t - 1}} + \left[ {\begin{array}{*{20}{c}}
% 0&{0.1}&{0.2}\\
% {0.2}&{ - 0.2}&0\\
% {0.7}&{ - 0.2}&{0.3}
% \end{array}} \right]\Delta {y_{t - 1}} + {\varepsilon _t}.
% \end{array}
% The innovations are multivariate Gaussian with a mean of 0 and the covariance matrix
% \Sigma  = \left[
% {\begin{array}{*{20}{c}}{1.3}&{0.4}&{1.6}\\{0.4}&{0.6}&0.7\\{1.6}&0.7&5\end{array}}
% \right].
% Create variables for the parameter values.

Adjustment = [-0.3 0.3; -0.2 0.1; -1 0];
Cointegration = [0.1 -0.7; -0.2 0.5; 0.2 0.2];
ShortRun = {[0. 0.1 0.2; 0.2 -0.2 0; 0.7 -0.2 0.3]};
Constant = [-1; -3; -30];
Trend = [0; 0; 0];
Covariance = [1.3 0.4 1.6; 0.4 0.6 0.7; 1.6 0.7 5];

%
% Create a vecm model object representing the VEC(1) model using the appropriate name-value pair arguments.

Mdl = vecm('Adjustment',Adjustment,'Cointegration',Cointegration,...
    'Constant',Constant,'ShortRun',ShortRun,'Trend',Trend,...
    'Covariance',Covariance)

% Mdl is, effectively, a fully specified vecm model object. That is, the cointegration constant and linear trend are unknown. However, they are not needed for simulating observations or forecasting, given that the overall constant and trend parameters are known.
% By default, vecm attributes the short-run coefficient to the first lag in the short-run polynomial. Consider another VEC model that attributes the short-run coefficient matrix ShortRun to the fourth lag term, specifies a matrix of zeros for the first lag coefficient, and treats all else as being equal to Mdl. Create this VEC(4) model.
%

Mdl.ShortRun(4) = ShortRun;
Mdl.ShortRun(1) = {0}

% Alternatively, you can create another model object using vecm and the same syntax as for Mdl, but additionally specify 'Lags',4.
% Copyright 2012 The MathWorks, Inc.