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 () 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= option or the YLAG=
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=
or YLAG=
(or that corresponds to both NSTATE=
and YLAG=
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
SIGMAorCOVparameter matrix are set to ones if theSIGMAorCOVparameter matrix is to be estimated.If a row of the
TPMparameter matrix contains all zeros, each element in the row is set to, where K is the number of states; if a row of the
TPMparameter 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
ISPVparameter vector are zeros, each element of theISPVparameter vector is set to, where K is the number of states; if the sum of the
ISPVparameter vector is not equal to one, it is normalized by dividing each element of theISPVparameter vector by the sum of theISPVparameter vector.The value of the
LAMBDAparameter vector for each state is set to one if theLAMBDAparameter 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;