Next: Downloading H2M Up: H2M : A set Previous: Functions in the H2M/cnt

To do

What follows is a remark that could be useful for people needing to adapt the code to a new type of model rather than an actual wishlist since I don't plan to to this myself at the moment.

If you take a look at the code in nbh_em, ph_em or pm_em and compare these with the corresponding functions for multivariate Gaussian state conditional distributions (mix, hmm, etc) you will se that they are all very similar and that one could indeed develop generic routines for EM estimation of mixtures and HMMs. The only model specific elements that are needed are

  1. A routine that compute the density values given the data and the parameters characterizing the different model states (this is done by the function gauseval for multivariate Gaussian distributions).
  2. A routine that updates the parameters of the state conditional distributions given the a posteriori state probabilities (this is done by the hmm_dens for multivariate Gaussian distributions). This second function can be somewhat more difficult to implement since one needs to consider the precise form of the EM intermediate quantity, but usually this just boils down to a straightforward modification of the maximum likelihood computation in the corresponding model (see, for instance, the end of pm_em for the case of Poisson distributions).
Everything else (including the forward-backward recursions and the reestimation of the transition matrix and, if needed, of the initial states - that is functions such as hmm_fb, hmm_vit, hmm_tran or mix_post) is absolutely generic.

For doing this with MATLAB/OCTAVE, one would have to use eval statements (so as to allow passing the names of the above two routines as parameters) as well as variable number of input arguments (since all distributions do not have the same number of parameters). The latter could be done easilly in MATLAB (starting from V 5) using the varargin construct.


Next: Downloading H2M Up: H2M : A set Previous: Functions in the H2M/cnt

Olivier Cappé, Aug 24 2001