[R] Training parameters for a HMM

Claus O'Rourke claus.orourke at gmail.com
Mon Dec 19 19:25:24 CET 2011

I'm a newbie to the world of HMMs and HMMs in R. I've had a look at
the hmm package and the RHmm package but I couldn't see anything
straightforward on how a labelled sequential dataset with observed
values and underlying states might be used to construct and train a
HMM based on that data and no pre-computed values for the transition,
emission or initial state distributions. Does anyone have any excerpts
of code that could get me moving in the right direction?

To put it another way, lets say that I have the simple HMM topology
that is shown here:
And I have somehow collected datasets with observations and labelled
hidden states:

Sequence 1:
Obs     Hid
  y1        X1
  y2        X2
  y2        X2
  y4        X1
 ...          ...
  y3        X3


Sequence N:
Obs     Hid
  y2        X1
  y2        X2
  y2        X1
  y4        X1
 ...          ...
  y4        X1

I'm assuming categorial variables for y and x.

I know I really am starting from from scratch here, so I'd be very
grateful if anyone could point out to me how I could go about
automatically constructing and parameterizing a HMM for data like this.

Thanks for your patience.


More information about the R-help mailing list