|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
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.ScaledTransitionElement
public class ScaledTransitionElement
Scaled transition element for an HMM with scaled transition matrices (SHMM).
Field Summary | |
---|---|
protected String[] |
arrowOptions
The Graphviz options for distinguishing the arrows of the different transitions. |
protected double[] |
scalingFactor
The scaling factors of the individual transition classes. |
Fields inherited from class de.jstacs.sequenceScores.statisticalModels.trainable.hmm.transitions.elements.ReferenceBasedTransitionElement |
---|
annotationID, diagElement, ess, probabilities, statisticsTransitionProb |
Fields inherited from class de.jstacs.sequenceScores.statisticalModels.trainable.hmm.transitions.BasicHigherOrderTransition.AbstractTransitionElement |
---|
context, descendants, hyperParameters, logNorm, parameters, states, statistic |
Constructor Summary | |
---|---|
ScaledTransitionElement(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. |
|
ScaledTransitionElement(StringBuffer xml)
The standard constructor for the interface Storable . |
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 representation,
String contextNodeRepresentation,
NumberFormat nf,
String arrowOption,
boolean graphical)
This method appends all edges of the transition element to a given Graphviz representation. |
ScaledTransitionElement |
clone()
|
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 int |
getIndex(int pos,
Sequence seq)
Returns the index of the transition matrix used for 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()
This method initializes internal fields. |
void |
resetStatistic()
This method resets the sufficient statistic for the parameters. |
String |
toString(String[] stateNames)
This method returns a String representation of the transition element using the given names of the states. |
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, 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
Constructor Detail |
---|
public ScaledTransitionElement(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
- essscalingFactor
- scaling factorannotationID
- identifier for decoding transition classespublic ScaledTransitionElement(StringBuffer xml) throws NonParsableException
Storable
.
Constructs a ScaledTransitionElement
out of an XML representation.
xml
- the XML representation as StringBuffer
NonParsableException
- if the ScaledTransitionElement
could not be reconstructed out of
the StringBuffer
xml
Method Detail |
---|
protected void init()
BasicHigherOrderTransition.AbstractTransitionElement
init
in class ReferenceBasedTransitionElement
public ScaledTransitionElement clone() throws CloneNotSupportedException
clone
in class ReferenceBasedTransitionElement
CloneNotSupportedException
protected int getIndex(int pos, Sequence seq)
pos - 1
to pos
in sequences seq
.
pos
pos
- position in seqseq
- sequences
public void addToStatistic(int childIdx, double weight, Sequence sequence, int sequencePosition)
BasicHigherOrderTransition.AbstractTransitionElement
addToStatistic
in class BasicHigherOrderTransition.AbstractTransitionElement
childIdx
- the index of the descendant stateweight
- the weight to be addedsequence
- the sequence, which might be used to retrieve SequenceAnnotation
sequencePosition
- 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.AbstractTransitionElement
BasicHigherOrderTransition.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.AbstractTransitionElement
BasicHigherOrderTransition.AbstractTransitionElement.statistic
,
BasicHigherOrderTransition.AbstractTransitionElement.resetStatistic()
,
BasicHigherOrderTransition.AbstractTransitionElement.addToStatistic(int, double, Sequence, int)
,
TrainableTransition.estimateFromStatistic()
public double getLogScoreFor(int state, Sequence sequence, int sequencePosition)
BasicHigherOrderTransition.AbstractTransitionElement
index
.
getLogScoreFor
in class BasicHigherOrderTransition.AbstractTransitionElement
state
- the index of the childsequence
- the sequence, which might be used to retrieve SequenceAnnotation
sequencePosition
- the position within the sequence
index
protected void appendTransitions(StringBuffer representation, String contextNodeRepresentation, NumberFormat nf, String arrowOption, boolean graphical)
BasicHigherOrderTransition.AbstractTransitionElement
appendTransitions
in class BasicHigherOrderTransition.AbstractTransitionElement
representation
- 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 ReferenceBasedTransitionElement
xml
- the XML representationprotected void extractFurtherInformation(StringBuffer xml) throws NonParsableException
BasicHigherOrderTransition.AbstractTransitionElement
extractFurtherInformation
in class ReferenceBasedTransitionElement
xml
- the XML representation
NonParsableException
- if the information could not be reconstructed out of the StringBuffer
xml
protected String getXMLTag()
BasicHigherOrderTransition.AbstractTransitionElement
BasicHigherOrderTransition.AbstractTransitionElement.toXML()
.
getXMLTag
in class BasicHigherOrderTransition.AbstractTransitionElement
BasicHigherOrderTransition.AbstractTransitionElement.toXML()
public String toString(String[] stateNames)
BasicHigherOrderTransition.AbstractTransitionElement
String
representation of the transition element using the given names of the states.
toString
in class BasicHigherOrderTransition.AbstractTransitionElement
stateNames
- the names of the states, can be null
String
representation of the transition element using the given names of the states
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |