de.jstacs.sequenceScores.statisticalModels.trainable.hmm.transitions.elements
Class BasicPluginTransitionElement

java.lang.Object
  extended by de.jstacs.sequenceScores.statisticalModels.trainable.hmm.transitions.BasicHigherOrderTransition.AbstractTransitionElement
      extended by de.jstacs.sequenceScores.statisticalModels.trainable.hmm.transitions.elements.BasicTransitionElement
          extended by de.jstacs.sequenceScores.statisticalModels.trainable.hmm.transitions.elements.BasicPluginTransitionElement
All Implemented Interfaces:
Storable, Cloneable

public class BasicPluginTransitionElement
extends BasicTransitionElement

Basic transition element without random initialization of parameters.

Author:
Michael Seifert

Field Summary
 
Fields inherited from class de.jstacs.sequenceScores.statisticalModels.trainable.hmm.transitions.BasicHigherOrderTransition.AbstractTransitionElement
context, descendants, hyperParameters, logNorm, parameters, states, statistic
 
Constructor Summary
BasicPluginTransitionElement(int[] context, int[] states, double[] probs, double[] hyperParameters)
          Constructor creating a new instance with given context, descendant states, and hyper parameters.
BasicPluginTransitionElement(int[] context, int[] states, double[] probs, double[] hyperParameters, double[] weight)
          Constructor creating a new instance with given context, descendant states, and hyper parameters.
BasicPluginTransitionElement(StringBuffer xml)
          The standard constructor for the interface Storable.
 
Method Summary
protected  void appendFurtherInformation(StringBuffer xml)
          This method appends further information to the XML representation.
protected  void extractFurtherInformation(StringBuffer xml)
          This method extracts further information from the XML representation.
protected  String getXMLTag()
          This method returns the xml tag used in BasicHigherOrderTransition.AbstractTransitionElement.toXML().
 void initializeRandomly()
          This method draws new parameters from the prior.
 
Methods inherited from class de.jstacs.sequenceScores.statisticalModels.trainable.hmm.transitions.BasicHigherOrderTransition.AbstractTransitionElement
addToStatistic, appendGraphvizDescription, appendTransitions, clone, drawParametersFromStatistic, estimateFromStatistic, getArrowOption, getChild, getContext, getDescendant, getGraphvizEdgeWeight, getLabel, getLogGammaScoreFromStatistic, getLogPriorTerm, getLogScoreFor, getNextContext, getNumberOfChildren, getNumberOfParameters, init, joinStatistics, precompute, resetStatistic, setIndexOfDescendantTransitionElement, setParameters, toString, toString, toXML
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BasicPluginTransitionElement

public BasicPluginTransitionElement(int[] context,
                                    int[] states,
                                    double[] probs,
                                    double[] hyperParameters)
Constructor creating a new instance with given context, descendant states, and hyper parameters.

Parameters:
context - previously visited state indices; last entry corresponds to the last state visited
states - all possible states that can be reached from the context; if null then no transition allowed
probs - initial probabilities
hyperParameters - hyper-parameters for transitions; if null then no prior is used
See Also:
BasicPluginTransitionElement(int[], int[], double[], double[], double[])

BasicPluginTransitionElement

public BasicPluginTransitionElement(int[] context,
                                    int[] states,
                                    double[] probs,
                                    double[] hyperParameters,
                                    double[] weight)
Constructor creating a new instance with given context, descendant states, and hyper parameters.

Parameters:
context - previously visited state indices; last entry corresponds to the last state visited
states - all possible states that can be reached from the context; if null then no transition allowed
probs - initial probabilities
hyperParameters - hyper-parameters for transitions; if null then no prior is used
weight - the weight for plotting the edge in Graphviz, enables to modify the edge length, larger weights imply shorter edges (default: 1)

BasicPluginTransitionElement

public BasicPluginTransitionElement(StringBuffer xml)
                             throws NonParsableException
The standard constructor for the interface Storable. Constructs a BasicPluginTransitionElement out of an XML representation.

Parameters:
xml - the XML representation as StringBuffer
Throws:
NonParsableException - if the BasicPluginTransitionElement could not be reconstructed out of the StringBuffer xml
Method Detail

initializeRandomly

public void initializeRandomly()
Description copied from class: BasicHigherOrderTransition.AbstractTransitionElement
This method draws new parameters from the prior.

Overrides:
initializeRandomly in class BasicHigherOrderTransition.AbstractTransitionElement

appendFurtherInformation

protected void appendFurtherInformation(StringBuffer xml)
Description copied from class: BasicHigherOrderTransition.AbstractTransitionElement
This method appends further information to the XML representation. It allows subclasses to save further parameters that are not defined in the superclass.

Overrides:
appendFurtherInformation in class BasicTransitionElement
Parameters:
xml - the XML representation

extractFurtherInformation

protected void extractFurtherInformation(StringBuffer xml)
                                  throws NonParsableException
Description copied from class: BasicHigherOrderTransition.AbstractTransitionElement
This method extracts further information from the XML representation. It allows subclasses to cast further parameters that are not defined in the superclass.

Overrides:
extractFurtherInformation in class BasicTransitionElement
Parameters:
xml - the XML representation
Throws:
NonParsableException - if the information could not be reconstructed out of the StringBuffer xml

getXMLTag

protected String getXMLTag()
Description copied from class: BasicHigherOrderTransition.AbstractTransitionElement
This method returns the xml tag used in BasicHigherOrderTransition.AbstractTransitionElement.toXML().

Overrides:
getXMLTag in class BasicHigherOrderTransition.AbstractTransitionElement
Returns:
the xml tag used in BasicHigherOrderTransition.AbstractTransitionElement.toXML()