%% Create Partially Specified Multivariate Model for Estimation
% Consider fitting to data a three-state TAR model for a 2-D response process. Assume all parameters are unknown (includes transition two mid-levels t and all dynamic model coefficients and variances \theta).
% Create discrete threshold transitions at two unknown levels. This specification imples a three-state model.

t = [NaN NaN];
tt = threshold(t);

% tt is a partially specified threshold object. The transition mid-levels tt.Levels are completely unknown and estimable.
% Create 2-D VAR(0), VAR(1), and VAR(2) models by using the shorthand syntax of varm. Store the models in a vector.

mdl1 = varm(2,0);
mdl2 = varm(2,1);
mdl3 = varm(2,2);

mdl = [mdl1 mdl2 mdl3];
mdl(2)

% mdl contains three state-specific varm model templates for estimation. NaN values in the properties indicate estimable parameters.
% Create a threshold-switching model template from the switching mechanism tt and the state-specific submodels mdl.

Mdl = tsVAR(tt,mdl)
Mdl.Submodels(2)

% Mdl is a partially specified tsVAR model for estimation.
% Copyright 2021 The MathWorks, Inc.