|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.jstacs.sequenceScores.statisticalModels.trainable.hmm.transitions.BasicHigherOrderTransition.AbstractTransitionElement
de.jstacs.sequenceScores.statisticalModels.trainable.hmm.transitions.elements.BasicTransitionElement
de.jstacs.sequenceScores.statisticalModels.trainable.hmm.transitions.elements.ReferenceBasedTransitionElement
public class ReferenceBasedTransitionElement
This class implements transition elements that utilize a reference sequence to determine the transition probability.
The reference sequence is given as annotation of the original sequence and can be utilized using annotationID.
ReferenceSequenceAnnotation| Field Summary | |
|---|---|
protected String |
annotationID
The annotation id used for determining the transition matrix from the ReferenceSequenceAnnotations. |
protected int |
diagElement
The index of the self transition. |
protected double |
ess
The equivalent sample size (ess) used in the prior of this instance. |
protected double[] |
probabilities
Represents the initial the transition probabilities. |
protected double[][] |
statisticsTransitionProb
Represents the gammas required for estimating the transition probabilities not including pseudocounts. |
| Fields inherited from class de.jstacs.sequenceScores.statisticalModels.trainable.hmm.transitions.BasicHigherOrderTransition.AbstractTransitionElement |
|---|
context, descendants, hyperParameters, logNorm, parameters, states, statistic |
| Constructor Summary | |
|---|---|
ReferenceBasedTransitionElement(int[] context,
int[] states,
double ess,
double[] probabilities,
String annotationID)
Creates an ReferenceBasedTransitionElement representing a conditional transition probability distribution of a Hidden Markov TrainableStatisticalModel for the given context. |
|
ReferenceBasedTransitionElement(int[] context,
int[] states,
double ess,
double[] probabilities,
String annotationID,
double[] weight)
Creates an ReferenceBasedTransitionElement representing a conditional transition probability distribution of a Hidden Markov TrainableStatisticalModel for the given context. |
|
ReferenceBasedTransitionElement(StringBuffer xml)
The standard constructor for the interface Storable. |
|
| Method Summary | |
|---|---|
protected void |
appendFurtherInformation(StringBuffer xml)
This method appends further information to the XML representation. |
ReferenceBasedTransitionElement |
clone()
|
protected void |
determineDiagonalElement()
This method determines the self transition. |
protected void |
extractFurtherInformation(StringBuffer xml)
This method extracts further information from the XML representation. |
double |
getLogGammaScoreFromStatistic()
This method calculates a score for the current statistics, which is independent from the current parameters In general the gamma-score is a product of gamma-functions parameterized with the current statistics |
double |
getLogPriorTerm()
Returns a value that is proportional to the log of the prior. |
protected void |
init()
This method initializes internal fields. |
void |
initializeRandomly()
This method draws new parameters from the prior. |
protected void |
precompute()
This method precomputes internal fields as for instance the normalization constant. |
| Methods inherited from class de.jstacs.sequenceScores.statisticalModels.trainable.hmm.transitions.BasicHigherOrderTransition.AbstractTransitionElement |
|---|
addToStatistic, appendGraphvizDescription, appendTransitions, drawParametersFromStatistic, estimateFromStatistic, getArrowOption, getChild, getContext, getDescendant, getGraphvizEdgeWeight, getLabel, getLogScoreFor, getNextContext, getNumberOfChildren, getNumberOfParameters, getXMLTag, joinStatistics, resetStatistic, setIndexOfDescendantTransitionElement, setParameters, toString, toString, toXML |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected String annotationID
ReferenceSequenceAnnotations.
protected double[] probabilities
protected double[][] statisticsTransitionProb
protected double ess
protected int diagElement
| Constructor Detail |
|---|
public ReferenceBasedTransitionElement(int[] context,
int[] states,
double ess,
double[] probabilities,
String annotationID)
ReferenceBasedTransitionElement representing a conditional transition probability distribution of a Hidden Markov TrainableStatisticalModel for the given context.
context - context of statesstates - states that can be reached from the contextprobabilities - transition probabilities from the context to the statesess - the equivalent sample size (ess)annotationID - identifier for decoding transition classesReferenceBasedTransitionElement(int[], int[], double, double[], String, double[])
public ReferenceBasedTransitionElement(int[] context,
int[] states,
double ess,
double[] probabilities,
String annotationID,
double[] weight)
ReferenceBasedTransitionElement representing a conditional transition probability distribution of a Hidden Markov TrainableStatisticalModel for the given context.
context - context of statesstates - states that can be reached from the contextprobabilities - transition probabilities from the context to the statesess - the equivalent sample size (ess)annotationID - identifier for decoding transition classesweight - the weight for plotting the edge in Graphviz, enables to modify the edge length, larger weights imply shorter edges (default: 1)
public ReferenceBasedTransitionElement(StringBuffer xml)
throws NonParsableException
Storable.
Constructs a ReferenceBasedTransitionElement out of an XML representation.
xml - the XML representation as StringBuffer
NonParsableException - if the ReferenceBasedTransitionElement could not be reconstructed out of
the StringBuffer xml| Method Detail |
|---|
protected void init()
BasicHigherOrderTransition.AbstractTransitionElement
init in class BasicHigherOrderTransition.AbstractTransitionElement
public ReferenceBasedTransitionElement clone()
throws CloneNotSupportedException
clone in class BasicHigherOrderTransition.AbstractTransitionElementCloneNotSupportedExceptionprotected void determineDiagonalElement()
diagElementprotected void precompute()
BasicHigherOrderTransition.AbstractTransitionElement
precompute in class BasicHigherOrderTransition.AbstractTransitionElementBasicHigherOrderTransition.AbstractTransitionElement.logNormpublic double getLogPriorTerm()
BasicHigherOrderTransition.AbstractTransitionElement
getLogPriorTerm in class BasicHigherOrderTransition.AbstractTransitionElementTransition.getLogPriorTerm()public double getLogGammaScoreFromStatistic()
BasicHigherOrderTransition.AbstractTransitionElement
getLogGammaScoreFromStatistic in class BasicHigherOrderTransition.AbstractTransitionElementpublic void initializeRandomly()
BasicHigherOrderTransition.AbstractTransitionElement
initializeRandomly in class BasicHigherOrderTransition.AbstractTransitionElementprotected void appendFurtherInformation(StringBuffer xml)
BasicHigherOrderTransition.AbstractTransitionElement
appendFurtherInformation in class BasicTransitionElementxml - the XML representation
protected void extractFurtherInformation(StringBuffer xml)
throws NonParsableException
BasicHigherOrderTransition.AbstractTransitionElement
extractFurtherInformation in class BasicTransitionElementxml - the XML representation
NonParsableException - if the information could not be reconstructed out of the StringBuffer xml
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||