public class ReferenceBasedTransitionElement extends BasicTransitionElement
annotationID
.ReferenceSequenceAnnotation
Modifier and Type | Field and Description |
---|---|
protected String |
annotationID
The annotation id used for determining the transition matrix from the
ReferenceSequenceAnnotation s. |
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.
|
context, descendants, hyperParameters, logNorm, parameters, states, statistic
Constructor and Description |
---|
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 . |
Modifier and Type | Method and Description |
---|---|
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.
|
addToStatistic, appendGraphvizDescription, appendTransitions, drawParametersFromStatistic, estimateFromStatistic, getArrowOption, getChild, getContext, getDescendant, getGraphvizEdgeWeight, getLabel, getLastContextState, getLogScoreFor, getNextContext, getNumberOfChildren, getNumberOfParameters, getXMLTag, joinStatistics, resetStatistic, setIndexOfDescendantTransitionElement, setParameters, toString, toString, toXML
protected String annotationID
ReferenceSequenceAnnotation
s.protected double[] probabilities
protected double[][] statisticsTransitionProb
protected double ess
protected int diagElement
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
protected void init()
BasicHigherOrderTransition.AbstractTransitionElement
init
in class BasicHigherOrderTransition.AbstractTransitionElement
public ReferenceBasedTransitionElement clone() throws CloneNotSupportedException
clone
in class BasicHigherOrderTransition.AbstractTransitionElement
CloneNotSupportedException
protected void determineDiagonalElement()
diagElement
protected void precompute()
BasicHigherOrderTransition.AbstractTransitionElement
precompute
in class BasicHigherOrderTransition.AbstractTransitionElement
BasicHigherOrderTransition.AbstractTransitionElement.logNorm
public double getLogPriorTerm()
BasicHigherOrderTransition.AbstractTransitionElement
getLogPriorTerm
in class BasicHigherOrderTransition.AbstractTransitionElement
Transition.getLogPriorTerm()
public double getLogGammaScoreFromStatistic()
BasicHigherOrderTransition.AbstractTransitionElement
getLogGammaScoreFromStatistic
in class BasicHigherOrderTransition.AbstractTransitionElement
public void initializeRandomly()
BasicHigherOrderTransition.AbstractTransitionElement
initializeRandomly
in class BasicHigherOrderTransition.AbstractTransitionElement
protected void appendFurtherInformation(StringBuffer xml)
BasicHigherOrderTransition.AbstractTransitionElement
appendFurtherInformation
in class BasicTransitionElement
xml
- the XML representationprotected void extractFurtherInformation(StringBuffer xml) throws NonParsableException
BasicHigherOrderTransition.AbstractTransitionElement
extractFurtherInformation
in class BasicTransitionElement
xml
- the XML representationNonParsableException
- if the information could not be reconstructed out of the StringBuffer
xml