%% Create Discrete Threshold Transition
% Create a threshold transition at mid-level t_1 =0.

t1 = 0;
tt = threshold(t1)

% tt is a threshold object representing a discrete threshold transition at mid-level 0. tt is fully specified because its properties do not contain NaN values.  Therefore, you can pass tt to any threshold object function
% Given a univariate threshold variable, tt divides the range of the variable into two distinct states, which tt labels "1" and "2". tt also specifies the switching mechanism of a threshold-switching autoregressive (TAR) model, represented by a tsVAR object. Given values of the observed univariate transition variable:
% The TAR model is in state "1" when the transition variable is in the interval \left(-\infty ,0\right).
% The TAR model is in state "2" when the transition variable is in the interval [0,\infty).
% Copyright 2021 The MathWorks, Inc.