Pattern Recognition and Machine Learning

(Jeff_L) #1
13.2. Hidden Markov Models 613

k=1

k=2

k=3

0 0.5 1

0

0.5

1

0 0.5 1

0

0.5

1

Figure 13.8 Illustration of sampling from a hidden Markov model having a 3-state latent variablezand a
Gaussian emission modelp(x|z)wherexis 2-dimensional. (a) Contours of constant probability density for the
emission distributions corresponding to each of the three states of the latent variable. (b) A sample of 50 points
drawn from the hidden Markov model, colour coded according to the component that generated them and with
lines connecting the successive observations. Here the transition matrix was fixed so that in any state there is a
5% probability of making a transition to each of the other states, and consequently a 90% probability of remaining
in the same state.


Gaussians, we first chose one of the components at random with probability given by
the mixing coefficientsπkand then generate a sample vectorxfrom the correspond-
ing Gaussian component. This process is repeatedNtimes to generate a data set of
Nindependent samples. In the case of the hidden Markov model, this procedure is
modified as follows. We first choose the initial latent variablez 1 with probabilities
governed by the parametersπkand then sample the corresponding observationx 1.
Now we choose the state of the variablez 2 according to the transition probabilities
p(z 2 |z 1 )using the already instantiated value ofz 1. Thus suppose that the sample for
z 1 corresponds to statej. Then we choose the statekofz 2 with probabilitiesAjk
fork=1,...,K. Once we knowz 2 we can draw a sample forx 2 and also sample
the next latent variablez 3 and so on. This is an example of ancestral sampling for
Section 8.1.2 a directed graphical model. If, for instance, we have a model in which the diago-
nal transition elementsAkkare much larger than the off-diagonal elements, then a
typical data sequence will have long runs of points generated from a single compo-
nent, with infrequent transitions from one component to another. The generation of
samples from a hidden Markov model is illustrated in Figure 13.8.
There are many variants of the standard HMM model, obtained for instance by
imposing constraints on the form of the transition matrixA(Rabiner, 1989). Here we
mention one of particular practical importance called theleft-to-rightHMM, which
is obtained by setting the elementsAjkofAto zero ifk<j, as illustrated in the

Free download pdf