HMM Procedure

INITIAL Statement

  • INITIAL equation <, …, equation>;

The INITIAL statement specifies the initial parameter values for nonlinear optimization when the maximum likelihood method or the maximum a posteriori method is applied to the estimation of the HMMs (that is, METHOD=ML or METHOD=MAP, respectively, in the MODEL statement). Only one INITIAL statement is allowed. If you specify more than one equation, separate them with commas. The INITIAL statement supports only equations; hence, inequality comparison operators (<, <=, >, and >=) and the distribution operator (tilde) are not supported in the INITIAL statement. If you omit this statement, the initial values of parameters are determined by the input data.

If you specify the NSTATE=n 1 colon n 2 option or the YLAG=m 1 colon m 2 option (or both) in the MODEL statement to estimate multiple models, the INITIAL statement is applied to the first model that corresponds to the specification of NSTATE=n 1 or YLAG=m 1 (or that corresponds to both NSTATE=n 1 and YLAG=m 1 if both options are specified).

To use the INITIAL statement, you need to know the form of the model: different sets of parameters are available for different types of HMMs. Nonlinear equations on parameters are not supported.

The equation is in the form of a matrix expression. For more information about the matrix expression, see the section Matrix Expression.

The initial parameter values are values that solve the specified linear equations. If you do not specify initial values for all parameters, the default initial value for any parameter that is not specified in the INITIAL statement is 0, except for the following:

  • The diagonal elements of the SIGMA or COV parameter matrix are set to ones if the SIGMA or COV parameter matrix is to be estimated.

  • If a row of the TPM parameter matrix contains all zeros, each element in the row is set to 1 slash upper K, where K is the number of states; if a row of the TPM parameter matrix does not add up to one, the row is normalized by dividing each element in the row by the sum of the row.

  • If all elements of the ISPV parameter vector are zeros, each element of the ISPV parameter vector is set to 1 slash upper K, where K is the number of states; if the sum of the ISPV parameter vector is not equal to one, it is normalized by dividing each element of the ISPV parameter vector by the sum of the ISPV parameter vector.

  • The value of the LAMBDA parameter vector for each state is set to one if the LAMBDA parameter vector is to be estimated.

The following example uses the INITIAL statement for a bivariate three-state Gaussian HMM, which PROC HMM estimates by the maximum likelihood method by default:

proc hmm data=One;
   id time = t;
   model y1 y2 / type=gaussian nstate=3;
   initial TPM={0.8 0.1 0.1, 0.2 0.7 0.1, 0.9 0.05 0.05},
           MU={-1 -1, 0 0, 1 1}`,
           SIGMA(1)=4*I(2),
           SIGMA(2)=I(2),
           SIGMA(3)=4*I(2)+2;
run;
Last updated: July 09, 2026