The HMM Procedure

MODEL Statement

  • MODEL dependents < = regressors > < / options > ;

The MODEL statement specifies dependent (endogenous) variables and regressors (the independent or exogenous variables) for the HMM model. Only one MODEL statement is allowed.

You can specify the following options after a forward slash (/):

ARMEAN=ADJUSTED | STANDARD

specifies the mean form in a regime-switching autoregression model. The ARMEAN= option applies only when you specify the TYPE=AR option in the MODEL statement. You can specify the following values:

ADJUSTED

specifies the mean-adjusted form of regime-switching autoregression model.

STANDARD

specifies the standard regime-switching autoregression model.

By default, METHOD=STANDARD.

ESTISPV

estimates the initial state probability vector (ISPV). By default, the ISPV is fixed to the stationary distribution of the Markov chain. For the finite-state-space and homogeneous HMM, the stationary distribution of the Markov chain is the pi such that pi prime upper A equals pi prime, where A is the transition probability matrix (TPM); that is, pi is the leading left eigenvector of A. If you do not specify this option but you do specify the ISPV function in the INITIAL or PRIOR statement, the HMM procedure issues errors and then stops.

METHOD=MAP | ML

requests the type of estimates to be computed. You can specify the following values:

MAP

specifies the maximum a posteriori method.

ML

specifies the maximum likelihood method.

By default, METHOD=ML.

NCATEGORY=number

specifies the number of categories in a state for a finite HMM, where number must be a positive integer. This option applies only when you specify TYPE=FINITE. By default, NCATEGORY=2.

NCOMPONENT=number

specifies the number of components in a state for a Gaussian mixture HMM (GM HMM), where number must be a positive integer. This option applies only when you specify TYPE=GAUSSIANMIXTURE. By default, NCOMPONENT=1.

NOCURRENTX

suppresses the present values of the exogenous variables. This option applies only when you specify TYPE=AR or TYPE=REG.

NOINT

suppresses the constant (intercept) parameters. This option applies only when you specify TYPE=AR or TYPE=REG.

NSEASON=s

specifies the number of seasonal periods (where s must be a positive integer) and adds (snegative 1) seasonal dummies to the regressors. This option applies only when you specify TYPE=AR or TYPE=REG and do not specify the NOINT option.

NSTATE=number1 < : number2 >

specifies the number or the range of numbers of hidden states, where number1 and number2 must be positive integers. If you specify NSTATE=number1, the number of hidden states is number1; if you specify NSTATE=number1:number2, multiple models whose number of hidden states is inclusively between number1 and number2 are estimated and inferred. If you specify the same number for both number1 and number2, number2 is ignored. By default, NSTATE=2.

SCENTER

centers seasonal dummies that are implied by the NSEASON= option. The centered seasonal dummies are generated by c minus StartFraction 1 Over s EndFraction, where c is a seasonal dummy that the NSEASON=s option generates. This option applies only when you specify the NSEASON= option and TYPE=AR or TYPE=REG.

STATEINDEPENDENT=(name-list)

specifies the parameters to be estimated independent of state. The names of the independent parameters are entered in the name-list in parentheses. The names that can appear in the name-list are ISPV, TPM, MCP, CPM, MU, SIGMA, CONST, SDUMMY, LTREND, QTREND, XL, AR, and COV. Table 4 gives the meanings of these names. This option does not support inputting the component index after the parameter names. For example, it supports COV but not COV(1,1,1). The name ISPV is ignored unless ESTISPV is also specified. Any parameters that are not in the model are ignored. Currently this option does not support ALGORITHM=SGD in the OPTIMIZE statement. The estimates are ordered by the names specified in the name-list.

To see how this option works, consider the following univariate bistate Gaussian HMM, which is described by the parameters StartSet pi comma bold upper A comma bold upper B EndSet, where pi is the initial state probability vector, bold upper A is the transition probability matrix, bold upper B identical-to StartSet mu 1 comma normal upper Sigma 1 comma mu 2 comma normal upper Sigma 2 EndSet, mu 1 and normal upper Sigma 1 are the mean and covariance parameters for state 1, and mu 2 and normal upper Sigma 2 are the mean and covariance parameters for state 2. STATEINDEPENDENT=(SIGMA) estimates the model with normal upper Sigma 1 equals normal upper Sigma 2. The following statement specifies this option:

model y / stateindependent=(sigma);

For more details and an example, see Analysis of the Business Cycle by Using the Regime-Switching Mean-Adjusted Autoregression Model.

TREND=LINEAR | QUAD

specifies the degree of deterministic time trend that the model includes. You can specify the following values:

LINEAR

includes a linear time trend as a regressor.

QUAD

includes linear and quadratic time trends as regressors.

This option applies only when you specify TYPE=AR or TYPE=REG.

TYPE=AR | FINITE | GAUSSIAN | GAUSSIANMIXTURE | POISSON | REG

specifies the type of the model of interest to use. You can specify the following values:

AR

uses the regime-switching autoregression model (RS-AR, also known as the autoregressive hidden Markov model, AR HMM).

FINITE

uses the finite hidden Markov model (finite HMM).

GAUSSIAN

uses the Gaussian hidden Markov model (Gaussian HMM).

GAUSSIANMIXTURE

uses the Gaussian mixture hidden Markov model (GM HMM).

POISSON

uses the Poisson hidden Markov model (Poisson HMM).

REG

uses the regime-switching regression model (RS-REG, also known as the regression hidden Markov model, REG HMM).

By default, TYPE=GAUSSIAN.

XLAG=number

specifies the lags of exogenous (independent) variables. To exclude the present values of exogenous variables from the model, you must specify the NOCURRENTX option. This option applies only when you specify TYPE=AR or TYPE=REG. By default, XLAG=0.

YLAG=number1 < : number2 >

specifies the order or the range of orders of the autoregressive process, where number1 and number2 must be nonnegative integers. If you specify YLAG=number1, the order of the autoregressive process is number1; if you specify YLAG=number1:number2, multiple models whose order of the autoregressive process is inclusively between number1 and number2 are estimated and inferred. If you specify the same number for both number1 and number2, number2 is ignored. This option applies only when you specify TYPE=AR. By default, YLAG=0.

Last updated: May 01, 2023