Class HMMMultinomialEstimator

  • All Implemented Interfaces:
    java.lang.Cloneable, Actor, Executable, FiringsRecordable, Initializable, TypedActor, Changeable, Debuggable, DebugListener, Derivable, Instantiable, ModelErrorHandler, MoMLExportable, Moveable, Nameable

    public class HMMMultinomialEstimator
    extends ParameterEstimator

    This actor implements a parameter estimator for Hidden Markov Models with Multinomial Emissions. The base class ParameterEstimator performs the parameter estimation and the HMMGaussianEstimator class contains density-specific methods for Multinomial emission calculations and produces the relevant estimates at its output ports.

    The output ports for a Gaussian HMM model are the mean and the standardDeviation vectors of the possible hidden states in addition to the HMM parameters independent from the emission density: transitionMatrix . T he mean is a double array output containing the mean estimates and sigma is a double array output containing standard deviation estimates of each mixture component. If the modelType is HMM, then an additional output, transitionMatrix is provided, which is an estimate of the transition matrix governing the Markovian process representing the hidden state evolution. If the modelType is MM, this port outputs a double array with the prior probability estimates of the mixture components.

    The user-defined parameters are initial guesses for the model parameters, given by m0, the mean vector guess, s0, the standard deviation vector guess, prior, the prior state distribution guess, A0, the transition matrix guess ( only for HMM). iterations is the number of EM iterations allowed until convergence. If, during iteration, the conditional log-likelihood of the observed sequence given the parameter estimates converges to a value within likelihoodThreshold, the parameter estimation stops iterating and delivers the parameter estimates.

    Since:
    Ptolemy II 10.0
    Version:
    $Id$
    Author:
    Ilge Akkaya
    Pt.AcceptedRating:
    Pt.ProposedRating:
    Red (ilgea)
    • Field Detail

      • emissionEstimates

        public TypedIOPort emissionEstimates
        An output that defines a probability mass estimate of the multinomial observation probabilities.
      • observationProbabilities

        public Parameter observationProbabilities
        An input guess array that defines a probability mass, defining the multinomial observation probabilities.
      • nCategories

        public Parameter nCategories
        Number of categories in the multinomial distribution.
    • Method Detail

      • attributeChanged

        public void attributeChanged​(Attribute attribute)
                              throws IllegalActionException
        Description copied from class: NamedObj
        React to a change in an attribute. This method is called by a contained attribute when its value changes. In this base class, the method does nothing. In derived classes, this method may throw an exception, indicating that the new attribute value is invalid. It is up to the caller to restore the attribute to a valid value if an exception is thrown.
        Overrides:
        attributeChanged in class ParameterEstimator
        Parameters:
        attribute - The attribute that changed.
        Throws:
        IllegalActionException - If the change is not acceptable to this container (not thrown in this base class).
      • postfire

        public boolean postfire()
                         throws IllegalActionException
        Description copied from class: AtomicActor
        Return true, unless stop() has been called, in which case, return false. Derived classes override this method to define operations to be performed at the end of every iteration of its execution, after one invocation of the prefire() method and any number of invocations of the fire() method. This method typically wraps up an iteration, which may involve updating local state. In derived classes, this method returns false to indicate that this actor should not be fired again.
        Specified by:
        postfire in interface Executable
        Overrides:
        postfire in class AtomicActor<TypedIOPort>
        Returns:
        True if execution can continue into the next iteration.
        Throws:
        IllegalActionException - Not thrown in this base class.
      • _checkForConvergence

        protected boolean _checkForConvergence​(int iterations)
        Description copied from class: ParameterEstimator
        Check whether the gradient-descent algorithm has converged.
        Specified by:
        _checkForConvergence in class ParameterEstimator
        Parameters:
        iterations - Current iteration index
        Returns:
        boolean indicating whether algorithm has converged