3.2. HMMs

HMMs can also be encoded as a textual file. Its syntax is quite straightforward, so it will be explained by means of an example.

Hmm v1.0

NbStates 5

State
Pi 0.1
A 0.1 0.2 0.3 0.4 0.0 
IntegerOPDF [0.4 0.6 ]

State
Pi 0.3
A 0.2 0.2 0.2 0.2 0.2 
IntegerOPDF [0.5 0.5 ]

State
Pi 0.2
A 0.2 0.2 0.2 0.2 0.2 
IntegerOPDF [0.5 0.5 ]

State
Pi 0.2
A 0.2 0.2 0.2 0.2 0.2 
IntegerOPDF [0.5 0.5 ]

State
Pi 0.2
A 0.2 0.2 0.2 0.2 0.2 
IntegerOPDF [0.5 0.5 ]

All the white space characters (tab, space, new line,...) are treated the same, and several white spaces are equivalent to a signle one. So, for example, the whole file could be encoded as a single line.

The first line just gives the file syntax's version number. The NbStates keyword of course gives the number of states of the HMM described.

After that comes a list of n state descriptions, where n is the HMM's number of states. This list is ordered, so the i-th element of the list matches the i-th state. Each such description is composed of: