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
gauseval
for multivariate Gaussian distributions).
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).
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.
Olivier Cappé, Aug 24 2001