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
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.
|
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, toXMLprotected String annotationID
ReferenceSequenceAnnotations.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 StringBufferNonParsableException - if the ReferenceBasedTransitionElement could not be reconstructed out of
the StringBuffer xmlprotected void init()
BasicHigherOrderTransition.AbstractTransitionElementinit in class BasicHigherOrderTransition.AbstractTransitionElementpublic ReferenceBasedTransitionElement clone() throws CloneNotSupportedException
clone in class BasicHigherOrderTransition.AbstractTransitionElementCloneNotSupportedExceptionprotected void determineDiagonalElement()
diagElementprotected void precompute()
BasicHigherOrderTransition.AbstractTransitionElementprecompute in class BasicHigherOrderTransition.AbstractTransitionElementBasicHigherOrderTransition.AbstractTransitionElement.logNormpublic double getLogPriorTerm()
BasicHigherOrderTransition.AbstractTransitionElementgetLogPriorTerm in class BasicHigherOrderTransition.AbstractTransitionElementTransition.getLogPriorTerm()public double getLogGammaScoreFromStatistic()
BasicHigherOrderTransition.AbstractTransitionElementgetLogGammaScoreFromStatistic in class BasicHigherOrderTransition.AbstractTransitionElementpublic void initializeRandomly()
BasicHigherOrderTransition.AbstractTransitionElementinitializeRandomly in class BasicHigherOrderTransition.AbstractTransitionElementprotected void appendFurtherInformation(StringBuffer xml)
BasicHigherOrderTransition.AbstractTransitionElementappendFurtherInformation in class BasicTransitionElementxml - the XML representationprotected void extractFurtherInformation(StringBuffer xml) throws NonParsableException
BasicHigherOrderTransition.AbstractTransitionElementextractFurtherInformation in class BasicTransitionElementxml - the XML representationNonParsableException - if the information could not be reconstructed out of the StringBuffer xml