Package dev.nm.stat.hmm.discrete
Class DiscreteHMM
java.lang.Object
dev.nm.stat.markovchain.SimpleMC
dev.nm.stat.hmm.HMMRNG
dev.nm.stat.hmm.HiddenMarkovModel
dev.nm.stat.hmm.discrete.DiscreteHMM
- All Implemented Interfaces:
RandomNumberGenerator
,Seedable
- Direct Known Subclasses:
BaumWelch
This is the discrete hidden Markov model as defined by Rabiner.
-
Constructor Summary
ConstructorsConstructorDescriptionDiscreteHMM
(Vector PI, Matrix A, Matrix B) Constructs a discrete hidden Markov model.DiscreteHMM
(DiscreteHMM model) Copy constructor. -
Method Summary
Modifier and TypeMethodDescriptionB()
Gets the conditional probabilities of the observation symbols: rows correspond to state; columns corresponds symbols.double
density
(int state, double observation) Gets the (conditional) probability mass of making an observation in a particular state.int
nSymbols()
Gets the number of observation symbols per state.Methods inherited from class dev.nm.stat.hmm.HiddenMarkovModel
logProbability, logProbability, logProbability
Methods inherited from class dev.nm.stat.hmm.HMMRNG
next, nextDouble, seed
-
Constructor Details
-
DiscreteHMM
Constructs a discrete hidden Markov model.- Parameters:
PI
- the initial state probabilitiesA
- the state transition probabilitiesB
- the conditional probabilities of the observation symbols: rows correspond to state; columns corresponds symbols
-
DiscreteHMM
Copy constructor.- Parameters:
model
- aHiddenMarkovModel
-
-
Method Details
-
B
Gets the conditional probabilities of the observation symbols: rows correspond to state; columns corresponds symbols.- Returns:
- the observation symbol probabilities
-
nSymbols
public int nSymbols()Gets the number of observation symbols per state.- Returns:
- the number of observation symbols per state
-
density
public double density(int state, double observation) Gets the (conditional) probability mass of making an observation in a particular state.- Specified by:
density
in classHiddenMarkovModel
- Parameters:
state
- the hidden state label, counting from 1observation
- the observation value- Returns:
- the probability density/mass
-