|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.encog.ml.BasicML
org.encog.ml.hmm.HiddenMarkovModel
public class HiddenMarkovModel
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.
Field Summary | |
---|---|
static String |
TAG_COVARIANCE
|
static String |
TAG_DIST_TYPE
|
static String |
TAG_ITEMS
|
static String |
TAG_MEAN
|
static String |
TAG_PI
|
static String |
TAG_PROBABILITIES
|
static String |
TAG_STATES
|
static String |
TAG_TRANSITION
|
Constructor Summary | |
---|---|
HiddenMarkovModel(int states)
Construct a discrete HMM with the specified number of states. |
|
HiddenMarkovModel(int theStates,
int theItems)
|
|
HiddenMarkovModel(int theStates,
int[] theItems)
|
Method Summary | |
---|---|
HiddenMarkovModel |
clone()
|
HiddenMarkovModel |
cloneStructure()
|
StateDistribution |
createNewDistribution()
|
int[] |
getItems()
|
double[] |
getPi()
|
double |
getPi(int i)
|
int |
getStateCount()
|
StateDistribution |
getStateDistribution(int i)
|
int[] |
getStatesForSequence(MLDataSet seq)
Get the sates for the given sequence. |
double[][] |
getTransitionProbability()
|
double |
getTransitionProbability(int i,
int j)
|
boolean |
isContinuous()
|
boolean |
isDiscrete()
|
double |
lnProbability(MLDataSet seq)
|
double |
probability(MLDataSet seq)
Determine the probability of the specified sequence. |
double |
probability(MLDataSet seq,
int[] states)
Determine the probability for the specified sequence and states. |
void |
setPi(double[] data)
|
void |
setPi(int i,
double value)
|
void |
setStateDistribution(int i,
StateDistribution dist)
|
void |
setTransitionProbability(double[][] data)
|
void |
setTransitionProbability(int i,
int j,
double value)
|
void |
updateProperties()
Update any objeccts when a property changes. |
Methods inherited from class org.encog.ml.BasicML |
---|
getProperties, getPropertyDouble, getPropertyLong, getPropertyString, setProperty, setProperty, setProperty |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String TAG_STATES
public static final String TAG_ITEMS
public static final String TAG_PI
public static final String TAG_TRANSITION
public static final String TAG_DIST_TYPE
public static final String TAG_MEAN
public static final String TAG_COVARIANCE
public static final String TAG_PROBABILITIES
Constructor Detail |
---|
public HiddenMarkovModel(int states)
states
- The number of states.public HiddenMarkovModel(int theStates, int theItems)
public HiddenMarkovModel(int theStates, int[] theItems)
Method Detail |
---|
public HiddenMarkovModel clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
public HiddenMarkovModel cloneStructure()
public StateDistribution createNewDistribution()
public double getPi(int i)
public int getStateCount()
public StateDistribution getStateDistribution(int i)
public int[] getStatesForSequence(MLDataSet seq)
MLStateSequence
getStatesForSequence
in interface MLStateSequence
seq
- The sequence.
public double getTransitionProbability(int i, int j)
public boolean isContinuous()
public boolean isDiscrete()
public double lnProbability(MLDataSet seq)
public double probability(MLDataSet seq)
MLStateSequence
probability
in interface MLStateSequence
seq
- The sequence.
public double probability(MLDataSet seq, int[] states)
MLStateSequence
probability
in interface MLStateSequence
seq
- The sequence.states
- The states.
public void setPi(int i, double value)
public void setStateDistribution(int i, StateDistribution dist)
public void setTransitionProbability(int i, int j, double value)
public void updateProperties()
MLProperties
updateProperties
in interface MLProperties
updateProperties
in class BasicML
public int[] getItems()
public double[] getPi()
public double[][] getTransitionProbability()
public void setTransitionProbability(double[][] data)
public void setPi(double[] data)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |