Package dev.nm.stat.markovchain
Class MCUtils
- java.lang.Object
-
- dev.nm.stat.markovchain.MCUtils
-
public class MCUtils extends Object
These are the utility functions to examine a Markov chain.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static double[]
getObservations(HmmInnovation[] innovations, int state)
Get all observations that occur in a particular state.static Vector
getStateCounts(int[] states)
Count the numbers of occurrences of states.static DenseMatrix
getTransitionCounts(int[] states)
Count the numbers of times the state goes from one state to another.
-
-
-
Method Detail
-
getStateCounts
public static Vector getStateCounts(int[] states)
Count the numbers of occurrences of states.- Parameters:
states
- the Markov state labels, counting from 1- Returns:
- the numbers of occurrences
-
getTransitionCounts
public static DenseMatrix getTransitionCounts(int[] states)
Count the numbers of times the state goes from one state to another.- Parameters:
states
- the Markov state labels, counting from 1- Returns:
- the counts of transitions
-
getObservations
public static double[] getObservations(HmmInnovation[] innovations, int state)
Get all observations that occur in a particular state.- Parameters:
innovations
- the HMM innovationsstate
- a state- Returns:
- the observations in the state
-
-