HiddenMarkovModel
org.encog.ml.hmm

Class HiddenMarkovModel

  • All Implemented Interfaces:
    Serializable, Cloneable, MLMethod, MLProperties, MLStateSequence


    public class HiddenMarkovModelextends BasicMLimplements MLStateSequence, Serializable, Cloneable
    A Hidden Markov Model (HMM) is a Machine Learning Method that allows for predictions to be made about the hidden states and observations of a given system over time. A HMM can be thought of as a simple dynamic Bayesian network. The HMM is dynamic as it deals with changes that unfold over time. The Hidden Markov Model is made up of a number of states and observations. A simple example might be the state of the economy. There are three hidden states, such as bull market, bear market and level. We do not know which state we are currently in. However, there are observations that can be made such as interest rate and the level of the S&P500. The HMM learns what state we are in by seeing how the observations change over time. The HMM is only in one state at a given time. There is a percent probability that the HMM will move from one state to any of the other states. These probabilities are arranged in a grid, and are called the state transition probabilities. Observations can be discrete or continuous. These observations allow the HMM to predict state transitions. The HMM can handle single-value or multivariate observations. http://www.heatonresearch.com/wiki/Hidden_Markov_Model Rabiner, Juang, An introduction to Hidden Markov Models, IEEE ASSP Mag.,pp 4-16, June 1986. Baum, L. E.; Petrie, T. (1966). "Statistical Inference for Probabilistic Functions of Finite State Markov Chains" The Annals of Mathematical Statistics 37 (6): 1554-1563.
    See Also:
    Serialized Form
    • Constructor Detail

      • HiddenMarkovModel

        public HiddenMarkovModel(int states)
        Construct a discrete HMM with the specified number of states.
        Parameters:
        states - The number of states.
      • HiddenMarkovModel

        public HiddenMarkovModel(int theStates,                 int theItems)
      • HiddenMarkovModel

        public HiddenMarkovModel(int theStates,                 int[] theItems)
    • Method Detail

      • getPi

        public double getPi(int i)
      • getStateCount

        public int getStateCount()
      • getTransitionProbability

        public double getTransitionProbability(int i,                              int j)
      • isContinuous

        public boolean isContinuous()
      • isDiscrete

        public boolean isDiscrete()
      • lnProbability

        public double lnProbability(MLDataSet seq)
      • probability

        public double probability(MLDataSet seq)
        Description copied from interface: MLStateSequence
        Determine the probability of the specified sequence.
        Specified by:
        probability in interface MLStateSequence
        Parameters:
        seq - The sequence.
        Returns:
        The probability.
      • probability

        public double probability(MLDataSet seq,                 int[] states)
        Description copied from interface: MLStateSequence
        Determine the probability for the specified sequence and states.
        Specified by:
        probability in interface MLStateSequence
        Parameters:
        seq - The sequence.
        states - The states.
        Returns:
        The probability.
      • setPi

        public void setPi(int i,         double value)
      • setStateDistribution

        public void setStateDistribution(int i,                        StateDistribution dist)
      • setTransitionProbability

        public void setTransitionProbability(int i,                            int j,                            double value)
      • getItems

        public int[] getItems()
      • getPi

        public double[] getPi()
      • getTransitionProbability

        public double[][] getTransitionProbability()
      • setTransitionProbability

        public void setTransitionProbability(double[][] data)
      • setPi

        public void setPi(double[] data)

SCaVis 1.7 © jWork.org