|
||||||||||
| 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
de.jstacs.sequenceScores.statisticalModels.trainable.hmm.transitions.elements.DistanceBasedScaledTransitionElement
public class DistanceBasedScaledTransitionElement
Distance-based scaled transition element for an HMM with distance-scaled transition matrices (DSHMM).
| Field Summary | |
|---|---|
protected String |
arrowOptions
The Graphviz options for drawing the arrows. |
protected Hashtable<Sequence,double[]> |
diagonalWeights
Contains the single epsilons of the diagonal elements required for estimating the self-transition probability. |
protected double |
scalingFactor
The maximal scaling factor. |
protected double[] |
statisticsTransitionProb
Represents the summarized epsilons required for estimating the transition probabilities from the context. |
| Fields inherited from class de.jstacs.sequenceScores.statisticalModels.trainable.hmm.transitions.elements.ReferenceBasedTransitionElement |
|---|
annotationID, diagElement, ess, probabilities |
| Fields inherited from class de.jstacs.sequenceScores.statisticalModels.trainable.hmm.transitions.BasicHigherOrderTransition.AbstractTransitionElement |
|---|
context, descendants, hyperParameters, logNorm, parameters, states, statistic |
| Constructor Summary | |
|---|---|
DistanceBasedScaledTransitionElement(int[] context,
int[] states,
double[] probabilities,
double ess,
double scalingFactor,
String annotationID)
Creates an object representing the transition probabilities of a Hidden Markov TrainableStatisticalModel with scaled transition matrices (SHMM) for the given context. |
|
DistanceBasedScaledTransitionElement(int[] context,
int[] states,
double[] probabilities,
double ess,
double scalingFactor,
String annotationID,
double[] weight)
Creates an object representing the transition probabilities of a Hidden Markov TrainableStatisticalModel with scaled transition matrices (SHMM) for the given context. |
|
DistanceBasedScaledTransitionElement(StringBuffer xml)
Extracts a distance-base scaled transition element from XML. |
|
| Method Summary | |
|---|---|
void |
addToStatistic(int childIdx,
double weight,
Sequence sequence,
int sequencePosition)
This method adds a given weight to the sufficient statistic for the parameters. |
protected void |
appendFurtherInformation(StringBuffer xml)
This method appends further information to the XML representation. |
protected void |
appendTransitions(StringBuffer res,
String contextNodeRepresentation,
NumberFormat nf,
String arrowOption,
boolean graphical)
This method appends all edges of the transition element to a given Graphviz representation. |
DistanceBasedScaledTransitionElement |
clone()
Clones the object. |
void |
estimateFromStatistic()
This method estimates the parameters from the sufficient statistic. |
protected void |
extractFurtherInformation(StringBuffer xml)
This method extracts further information from the XML representation. |
protected double |
getIndex(int pos,
Sequence seq)
Returns the distance integrated into the transition from pos - 1 to pos in sequences seq. |
double |
getLogScoreFor(int state,
Sequence sequence,
int sequencePosition)
This method returns the score for the transition from the current context to the state with index index. |
protected String |
getXMLTag()
This method returns the xml tag used in BasicHigherOrderTransition.AbstractTransitionElement.toXML(). |
protected void |
init()
Basic initialization. |
void |
resetStatistic()
This method resets the sufficient statistic for the parameters. |
String |
toString(String[] stateNames)
|
| Methods inherited from class de.jstacs.sequenceScores.statisticalModels.trainable.hmm.transitions.elements.ReferenceBasedTransitionElement |
|---|
determineDiagonalElement, getLogGammaScoreFromStatistic, getLogPriorTerm, initializeRandomly, precompute |
| Methods inherited from class de.jstacs.sequenceScores.statisticalModels.trainable.hmm.transitions.BasicHigherOrderTransition.AbstractTransitionElement |
|---|
appendGraphvizDescription, drawParametersFromStatistic, getArrowOption, getChild, getContext, getDescendant, getGraphvizEdgeWeight, getLabel, getNextContext, getNumberOfChildren, getNumberOfParameters, joinStatistics, 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 arrowOptions
protected double scalingFactor
protected double[] statisticsTransitionProb
context.
protected Hashtable<Sequence,double[]> diagonalWeights
| Constructor Detail |
|---|
public DistanceBasedScaledTransitionElement(int[] context,
int[] states,
double[] probabilities,
double ess,
double scalingFactor,
String annotationID)
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)scalingFactor - scaling factorannotationID - identifier for decoding transition classesDistanceBasedScaledTransitionElement(int[], int[], double[], double, double, String, double[])
public DistanceBasedScaledTransitionElement(int[] context,
int[] states,
double[] probabilities,
double ess,
double scalingFactor,
String annotationID,
double[] weight)
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)scalingFactor - scaling factorannotationID - 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 DistanceBasedScaledTransitionElement(StringBuffer xml)
throws NonParsableException
xml - the XML-representation
NonParsableException - if the representation could not be parsed| Method Detail |
|---|
protected void init()
init in class ReferenceBasedTransitionElement
public DistanceBasedScaledTransitionElement clone()
throws CloneNotSupportedException
clone in class ReferenceBasedTransitionElementCloneNotSupportedException
protected double getIndex(int pos,
Sequence seq)
pos - 1 to pos in sequences seq.
pos - position in seqseq - sequences
public void addToStatistic(int childIdx,
double weight,
Sequence sequence,
int sequencePosition)
BasicHigherOrderTransition.AbstractTransitionElement
addToStatistic in class BasicHigherOrderTransition.AbstractTransitionElementchildIdx - the index of the descendant stateweight - the weight to be addedsequence - the sequence, which might be used to retrieve SequenceAnnotationsequencePosition - the position within the sequenceTransitionWithSufficientStatistic.addToStatistic(int, int, int, double, Sequence, int),
BasicHigherOrderTransition.AbstractTransitionElement.statistic,
BasicHigherOrderTransition.AbstractTransitionElement.resetStatistic(),
BasicHigherOrderTransition.AbstractTransitionElement.estimateFromStatistic(),
BasicHigherOrderTransition.AbstractTransitionElement.drawParametersFromStatistic()public void resetStatistic()
BasicHigherOrderTransition.AbstractTransitionElement
resetStatistic in class BasicHigherOrderTransition.AbstractTransitionElementBasicHigherOrderTransition.AbstractTransitionElement.statistic,
BasicHigherOrderTransition.AbstractTransitionElement.estimateFromStatistic(),
BasicHigherOrderTransition.AbstractTransitionElement.drawParametersFromStatistic(),
BasicHigherOrderTransition.AbstractTransitionElement.addToStatistic(int, double, Sequence, int),
TransitionWithSufficientStatistic.resetStatistic()public void estimateFromStatistic()
BasicHigherOrderTransition.AbstractTransitionElement
estimateFromStatistic in class BasicHigherOrderTransition.AbstractTransitionElementBasicHigherOrderTransition.AbstractTransitionElement.statistic,
BasicHigherOrderTransition.AbstractTransitionElement.resetStatistic(),
BasicHigherOrderTransition.AbstractTransitionElement.addToStatistic(int, double, Sequence, int),
TrainableTransition.estimateFromStatistic()
public double getLogScoreFor(int state,
Sequence sequence,
int sequencePosition)
BasicHigherOrderTransition.AbstractTransitionElementindex.
getLogScoreFor in class BasicHigherOrderTransition.AbstractTransitionElementstate - the index of the childsequence - the sequence, which might be used to retrieve SequenceAnnotationsequencePosition - the position within the sequence
index
protected void appendTransitions(StringBuffer res,
String contextNodeRepresentation,
NumberFormat nf,
String arrowOption,
boolean graphical)
BasicHigherOrderTransition.AbstractTransitionElement
appendTransitions in class BasicHigherOrderTransition.AbstractTransitionElementres - the current Graphviz representationcontextNodeRepresentation - the String representation of the context node(s)nf - the NumberFormat used for the probabilities, if null no probabilities will we writtenarrowOption - this parameter gives the possibility to set some arrow optiongraphical - represent transition probabilities as thickness of edges instead of textual outputBasicHigherOrderTransition.AbstractTransitionElement.appendGraphvizDescription(StringBuffer, NumberFormat, String, boolean),
BasicHigherOrderTransition.AbstractTransitionElement.getArrowOption(NumberFormat, double, double, String, boolean)protected void appendFurtherInformation(StringBuffer xml)
BasicHigherOrderTransition.AbstractTransitionElement
appendFurtherInformation in class ReferenceBasedTransitionElementxml - the XML representation
protected void extractFurtherInformation(StringBuffer xml)
throws NonParsableException
BasicHigherOrderTransition.AbstractTransitionElement
extractFurtherInformation in class ReferenceBasedTransitionElementxml - the XML representation
NonParsableException - if the information could not be reconstructed out of the StringBuffer xmlprotected String getXMLTag()
BasicHigherOrderTransition.AbstractTransitionElementBasicHigherOrderTransition.AbstractTransitionElement.toXML().
getXMLTag in class BasicHigherOrderTransition.AbstractTransitionElementBasicHigherOrderTransition.AbstractTransitionElement.toXML()public String toString(String[] stateNames)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||