

PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 
java.lang.Object gov.sandia.cognition.util.AbstractCloneableSerializable gov.sandia.cognition.learning.algorithm.hmm.MarkovChain
@PublicationReference(author="Wikipedia", title="Markov chain", type=WebPage, year=2010, url="http://en.wikipedia.org/wiki/Markov_chain") public class MarkovChain
A Markov chain is a random process that has a finite number of states with random transition probabilities between states at discrete time steps.
Field Summary  

static int 
DEFAULT_NUM_STATES
Default number of states, 3. 
protected Vector 
initialProbability
Initial probability Vector over the states. 
protected Matrix 
transitionProbability
Transition probability matrix. 
Constructor Summary  

MarkovChain()
Default constructor. 

MarkovChain(int numStates)
Creates a new instance of ContinuousDensityHiddenMarkovModel with uniform initial and transition probabilities. 

MarkovChain(Vector initialProbability,
Matrix transitionProbability)
Creates a new instance of ContinuousDensityHiddenMarkovModel 
Method Summary  

MarkovChain 
clone()
This makes public the clone method on the Object class and
removes the exception that it throws. 
protected static Vector 
createUniformInitialProbability(int numStates)
Creates a uniform initialprobability Vector 
protected static Matrix 
createUniformTransitionProbability(int numStates)
Creates a uniform transitionprobability Matrix 
Vector 
getFutureStateDistribution(Vector current,
int numSteps)
Simulates the Markov chain into the future, given the transition Matrix and the given current stateprobability distribution, for the given number of time steps into the future. 
Vector 
getInitialProbability()
Getter for initialProbability. 
int 
getNumStates()
Gets the number of states in the HMM. 
Vector 
getSteadyStateDistribution()
Returns the steadystate distribution of the state distribution. 
Matrix 
getTransitionProbability()
Getter for transitionProbability. 
void 
normalize()
Normalizes this Markov chain. 
protected void 
normalizeTransitionMatrix(Matrix A)
Normalizes the transitionprobability matrix 
protected static void 
normalizeTransitionMatrix(Matrix A,
int j)
Normalizes a column of the transitionprobability matrix 
void 
setInitialProbability(Vector initialProbability)
Setter for initialProbability 
void 
setTransitionProbability(Matrix transitionProbability)
Setter for transitionProbability. 
String 
toString()

Methods inherited from class java.lang.Object 

equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait 
Field Detail 

public static final int DEFAULT_NUM_STATES
protected Vector initialProbability
protected Matrix transitionProbability
Constructor Detail 

public MarkovChain()
public MarkovChain(int numStates)
numStates
 Number of states to use.public MarkovChain(Vector initialProbability, Matrix transitionProbability)
initialProbability
 Initial probability Vector over the states. Each entry must be
nonnegative and the Vector must sum to 1.transitionProbability
 Transition probability matrix. The entry (i,j) is the probability
of transition from state "j" to state "i". As a corollary, all
entries in the Matrix must be nonnegative and the
columns of the Matrix must sum to 1.Method Detail 

public MarkovChain clone()
AbstractCloneableSerializable
Object
class and
removes the exception that it throws. Its default behavior is to
automatically create a clone of the exact type of object that the
clone is called on and to copy all primitives but to keep all references,
which means it is a shallow copy.
Extensions of this class may want to override this method (but call
super.clone()
to implement a "smart copy". That is, to target
the most common use case for creating a copy of the object. Because of
the default behavior being a shallow copy, extending classes only need
to handle fields that need to have a deeper copy (or those that need to
be reset). Some of the methods in ObjectUtil
may be helpful in
implementing a custom clone method.
Note: The contract of this method is that you must use
super.clone()
as the basis for your implementation.
clone
in interface CloneableSerializable
clone
in class AbstractCloneableSerializable
protected static Vector createUniformInitialProbability(int numStates)
numStates
 Number of states to create the Vector for
protected static Matrix createUniformTransitionProbability(int numStates)
numStates
 Number of states to create the Matrix for
public Vector getInitialProbability()
public void setInitialProbability(Vector initialProbability)
initialProbability
 Initial probability Vector over the states. Each entry must be
nonnegative and the Vector must sum to 1.public Matrix getTransitionProbability()
public void setTransitionProbability(Matrix transitionProbability)
transitionProbability
 Transition probability matrix. The entry (i,j) is the probability
of transition from state "j" to state "i". As a corollary, all
entries in the Matrix must be nonnegative and the
columns of the Matrix must sum to 1.public void normalize()
protected static void normalizeTransitionMatrix(Matrix A, int j)
A
 Transition probability matrix to normalize, modified by side effectj
 Column of the matrix to normalizeprotected void normalizeTransitionMatrix(Matrix A)
A
 Transition probability matrix to normalize, modified by side effectpublic int getNumStates()
public String toString()
toString
in class Object
public Vector getSteadyStateDistribution()
public Vector getFutureStateDistribution(Vector current, int numSteps)
current
 Current distribution of probabilities of the various states.numSteps
 Number of steps into the future to simulate.


PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 