public interface Transition extends Cloneable, Storable
getLogScoreFor(int, int, int, Sequence, int)
, which
surprisingly has two additional parameter, namely the actual position and the sequence. These
additional parameters allow to switch between different transition matrices. For more details,
we refer, for instance, to ReferenceBasedTransitionElement
.
AbstractHMM
Modifier and Type | Method and Description |
---|---|
Transition |
clone()
This method returns a deep clone of the current instance.
|
void |
fillTransitionInformation(int layer,
int index,
int childIdx,
int[] container)
This method fills all relevant information for a specific edge in a given container.
|
int |
getChildIdx(int layer,
int index,
int state)
This method returns the child index of the state, if this state is no child of the context -1 is returned
|
String |
getGraphizNetworkRepresentation(NumberFormat nf,
String arrowOption,
boolean graphical)
This method returns a
String representation of the structure that
can be used in Graphviz to create an image. |
int |
getLastContextState(int layer,
int index)
The method returns the index of the state of the context, if there is no context -1 is returned.
|
double |
getLogPriorTerm()
Returns a value that is proportional to the log of the prior.
|
double |
getLogScoreFor(int layer,
int index,
int childIdx,
Sequence sequence,
int sequencePosition)
This method returns the logarithm of the score for the transition.
|
int |
getMaximalInDegree()
This method returns the maximal out degree of any context used in this transition instance.
|
int |
getMaximalMarkovOrder()
This method returns the maximal used Markov order.
|
int |
getMaximalNumberOfChildren()
This method returns the maximal number of children for any context used in this transition instance.
|
int |
getNumberOfChildren(int layer,
int index)
This method returns the number of children states for given index, i.e.
|
int |
getNumberOfIndexes(int layer)
This method computes the number of different indexes for a given layer of the matrix.
|
int |
getNumberOfStates()
This method returns the number of states underlying this transition
instance.
|
boolean |
hasAnySelfTransitions()
This method answers the question whether the instance models any self
transitions.
|
void |
initializeRandomly()
This method randomly initializes the parameters of the transition.
|
boolean[] |
isAbsoring()
This method returns for each state whether it is absorbing or not.
|
void |
setParameters(Transition t)
Set values of parameters of the instance to the value of the parameters of the given instance.
|
String |
toString(String[] stateNames,
NumberFormat nf)
This method returns a
String representation of the Transition using the given names of the states. |
Transition clone() throws CloneNotSupportedException
CloneNotSupportedException
- if the instance could not be clonedint getNumberOfChildren(int layer, int index)
layer
- the layer of the matrixindex
- the index encoding the contextint getMaximalMarkovOrder()
double getLogPriorTerm()
StatisticalModel.getLogPriorTerm()
int getNumberOfStates()
void initializeRandomly()
String getGraphizNetworkRepresentation(NumberFormat nf, String arrowOption, boolean graphical)
String
representation of the structure that
can be used in Graphviz to create an image.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 outputString
representation of the statevoid fillTransitionInformation(int layer, int index, int childIdx, int[] container)
layer
- the layer in the matrixindex
- the index encoding the contextchildIdx
- the index of the child that will be visitedcontainer
- container[0]
the index of the state;
container[1]
the index encoding the new context;
container[2]
the distance for the new layer, i.e. 0 for the same layer (=silent state), and 1 for the next layer (=non-silent state)double getLogScoreFor(int layer, int index, int childIdx, Sequence sequence, int sequencePosition)
layer
- the layer in the matrixindex
- the index encoding the contextchildIdx
- the index of the child that will be visitedsequence
- the sequencesequencePosition
- the position within the sequenceint getNumberOfIndexes(int layer)
layer
- the layer of the matrixboolean hasAnySelfTransitions()
true
if the current instance has
any self transitions, otherwise false
true
if the current instance has any self
transitions, otherwise false
int getMaximalInDegree()
int getMaximalNumberOfChildren()
int getLastContextState(int layer, int index)
layer
- the layer in the matrixindex
- the index encoding the contextint getChildIdx(int layer, int index, int state)
layer
- the layer in the matrixindex
- the index encoding the contextstate
- the index of the stateboolean[] isAbsoring()
String toString(String[] stateNames, NumberFormat nf)
String
representation of the Transition
using the given names of the states.stateNames
- the names of the states, can be null
nf
- the NumberFormat
for the String
representation of probabilitiesString
representation of the Transition
using the given names of the statesvoid setParameters(Transition t) throws IllegalArgumentException
t
- the transition with the parameters to be setIllegalArgumentException
- if the assumption about the same class for given and current instance is wrong