Package dev.nm.stat.hmm
Class HiddenMarkovModel
- java.lang.Object
-
- dev.nm.stat.markovchain.SimpleMC
-
- dev.nm.stat.hmm.HMMRNG
-
- dev.nm.stat.hmm.HiddenMarkovModel
-
- All Implemented Interfaces:
RandomNumberGenerator,Seedable
- Direct Known Subclasses:
DiscreteHMM,MixtureHMM
public abstract class HiddenMarkovModel extends HMMRNG
-
-
Constructor Summary
Constructors Constructor Description HiddenMarkovModel(Vector PI, Matrix A, RandomNumberGenerator[] B)HiddenMarkovModel(HMMRNG hmm)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract doubledensity(int state, double observation)Gets the (conditional) probability density/mass of making an observation in a particular state.doublelogProbability(int[] states, double[] obsverations)Gets the probability of observing the observations and having gone thru the state sequence.doublelogProbability(int[] states, int[] obsverations)Gets the probability of observing the observations and having gone thru the state sequence.doublelogProbability(HmmInnovation[] innovations)Gets the probability of observing the observations and having gone thru the state sequence.-
Methods inherited from class dev.nm.stat.hmm.HMMRNG
next, nextDouble, seed
-
-
-
-
Constructor Detail
-
HiddenMarkovModel
public HiddenMarkovModel(Vector PI, Matrix A, RandomNumberGenerator[] B)
-
HiddenMarkovModel
public HiddenMarkovModel(HMMRNG hmm)
-
-
Method Detail
-
density
public abstract double density(int state, double observation)Gets the (conditional) probability density/mass of making an observation in a particular state.- Parameters:
state- the hidden state label, counting from 1observation- the observation value- Returns:
- the probability density/mass
-
logProbability
public double logProbability(int[] states, double[] obsverations)Gets the probability of observing the observations and having gone thru the state sequence.- Parameters:
states- a sequence of the hidden statesobsverations- a sequence of corresponding observations- Returns:
- the probability of the occurrence
-
logProbability
public double logProbability(int[] states, int[] obsverations)Gets the probability of observing the observations and having gone thru the state sequence.- Parameters:
states- a sequence of the hidden statesobsverations- a sequence of corresponding observations- Returns:
- the probability of the occurrence
-
logProbability
public double logProbability(HmmInnovation[] innovations)
Gets the probability of observing the observations and having gone thru the state sequence.- Parameters:
innovations- a sequence of HMM innovations- Returns:
- the probability of the occurrence
-
-