de.jstacs.sequenceScores.statisticalModels.trainable.hmm.models
Class SamplingPhyloHMM
java.lang.Object
de.jstacs.sequenceScores.statisticalModels.trainable.AbstractTrainableStatisticalModel
de.jstacs.sequenceScores.statisticalModels.trainable.hmm.AbstractHMM
de.jstacs.sequenceScores.statisticalModels.trainable.hmm.models.HigherOrderHMM
de.jstacs.sequenceScores.statisticalModels.trainable.hmm.models.SamplingHigherOrderHMM
de.jstacs.sequenceScores.statisticalModels.trainable.hmm.models.SamplingPhyloHMM
- All Implemented Interfaces:
- SequenceScore, StatisticalModel, TrainableStatisticalModel, Storable, Cloneable
public class SamplingPhyloHMM
- extends SamplingHigherOrderHMM
This class implements an (higher order) HMM that contains multi-dimensional emissions described
by a phylogenetic tree. The model is trained by a Metropolis-Hastings algorithm.
- Author:
- Michael Scharfe
Fields inherited from class de.jstacs.sequenceScores.statisticalModels.trainable.hmm.AbstractHMM |
bwdMatrix, emission, emissionIdx, finalState, forward, fwdMatrix, name, sostream, START_NODE, states, threads, trainingParameter, transition |
Method Summary |
String |
getInstanceName()
Should return a short instance name such as iMM(0), BN(2), ... |
protected void |
getNewParameters()
This method set all parameters for the next sampling step |
Methods inherited from class de.jstacs.sequenceScores.statisticalModels.trainable.hmm.models.SamplingHigherOrderHMM |
acceptParameters, appendFurtherInformation, clone, createStates, drawFromStatistics, extractFurtherInformation, furtherInits, getLogPosteriorFromStatistic, getLogProbForPath, getLogStatePosteriorMatrixFor, getViterbiPath, getViterbiPathFor, getXMLTag, gibbsSampling, gibbsSamplingStep, initTraining, isInitialized, logProb, parseNextParameterSet, parseParameterSet, train |
Methods inherited from class de.jstacs.sequenceScores.statisticalModels.trainable.hmm.models.HigherOrderHMM |
baumWelch, createHelperVariables, estimateFromStatistics, fillBwdMatrix, fillBwdOrViterbiMatrix, fillFwdMatrix, fillLogStatePosteriorMatrix, finalize, getCharacteristics, getLogPriorTerm, getLogScoreFor, getLogScoreFor, getMaximalMarkovOrder, getNumericalCharacteristics, initialize, initializeRandomly, resetStatistics, samplePath, viterbi |
Methods inherited from class de.jstacs.sequenceScores.statisticalModels.trainable.hmm.AbstractHMM |
createMatrixForStatePosterior, decodePath, decodeStatePosterior, determineFinalStates, fromXML, getFinalStatePosterioriMatrix, getGraphvizRepresentation, getGraphvizRepresentation, getGraphvizRepresentation, getGraphvizRepresentation, getLogProbFor, getLogStatePosteriorMatrixFor, getNumberOfStates, getNumberOfThreads, getRunTimeException, getStatePosteriorMatrixFor, getStatePosteriorMatrixFor, getViterbiPathFor, getViterbiPathsFor, initTransition, provideMatrix, setOutputStream, toString, toXML, train |
SamplingPhyloHMM
public SamplingPhyloHMM(SamplingHMMTrainingParameterSet trainingParameterSet,
String[] name,
int[] emissionIdx,
boolean[] forward,
PhyloDiscreteEmission[] emission,
TransitionElement... te)
throws CloneNotSupportedException,
IllegalArgumentException,
WrongAlphabetException,
Exception
- This is the main constructor for a hidden markov model with phylogenetic emission(s)
This model can be trained using a metropolis hastings algorithm
- Parameters:
trainingParameterSet
- the ParameterSet
that determines the training algorithm and contains the necessary Parameter
sname
- the names of the statesemissionIdx
- the indices of the emissions that should be used for each stateforward
- a boolean array that indicates whether the symbol on the forward or the reverse complementary strand should be usedemission
- the emissionste
- the TransitionElement
s building a transition
- Throws:
CloneNotSupportedException
- if the parameters or the emissions or transition elements could not be cloned
IllegalArgumentException
- if one of the parameters is not allowed
WrongAlphabetException
- if the alphabet does not fit the model
Exception
- if something else went wrong
SamplingPhyloHMM
public SamplingPhyloHMM(StringBuffer xml)
throws NonParsableException
- The standard constructor for the interface
Storable
.
Constructs an SamplingPhyloHMM
out of an XML representation.
- Parameters:
xml
- the XML representation as StringBuffer
- Throws:
NonParsableException
- if the SamplingPhyloHMM
could not be reconstructed out of
the StringBuffer
xml
getInstanceName
public String getInstanceName()
- Description copied from interface:
SequenceScore
- Should return a short instance name such as iMM(0), BN(2), ...
- Specified by:
getInstanceName
in interface SequenceScore
- Overrides:
getInstanceName
in class SamplingHigherOrderHMM
- Returns:
- a short instance name
getNewParameters
protected void getNewParameters()
throws Exception
- Description copied from class:
SamplingHigherOrderHMM
- This method set all parameters for the next sampling step
- Overrides:
getNewParameters
in class SamplingHigherOrderHMM
- Throws:
Exception
- if something went wrong