de.jstacs.sequenceScores.statisticalModels.trainable.hmm.transitions
Interface TransitionWithSufficientStatistic

All Superinterfaces:
Cloneable, Storable, Transition
All Known Subinterfaces:
SamplingTransition, TrainableAndDifferentiableTransition, TrainableTransition
All Known Implementing Classes:
BasicHigherOrderTransition, HigherOrderTransition

public interface TransitionWithSufficientStatistic
extends Transition

This interface defines method for reseting and filling an internal sufficient statistic. Using this statistic the interfaces TrainableTransition and SamplingTransition can be used to estimate the parameters (cf. TrainableTransition.estimateFromStatistic()) or to draw new parameters (cf. SamplingFromStatistic.drawParametersFromStatistic()).

Author:
Jens Keilwagen
See Also:
TrainableTransition, SamplingTransition

Method Summary
 void addToStatistic(int layer, int index, int childIdx, double weight, Sequence sequence, int sequencePosition)
          This method allows to add a certain weight to the sufficient statistic of a specific transition.
 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
 void joinStatistics(Transition... transitions)
          This method joins the statistics of different instances and sets this joined statistic as statistic of each instance.
 void resetStatistic()
          This method reset the internal sufficient statistics that can be used for estimating the parameters.
 
Methods inherited from interface de.jstacs.sequenceScores.statisticalModels.trainable.hmm.transitions.Transition
clone, fillTransitionInformation, getChildIdx, getGraphizNetworkRepresentation, getLastContextState, getLogPriorTerm, getLogScoreFor, getMaximalInDegree, getMaximalMarkovOrder, getMaximalNumberOfChildren, getNumberOfChildren, getNumberOfIndexes, getNumberOfStates, hasAnySelfTransitions, initializeRandomly, isAbsoring, setParameters, toString
 
Methods inherited from interface de.jstacs.Storable
toXML
 

Method Detail

resetStatistic

void resetStatistic()
This method reset the internal sufficient statistics that can be used for estimating the parameters.


addToStatistic

void addToStatistic(int layer,
                    int index,
                    int childIdx,
                    double weight,
                    Sequence sequence,
                    int sequencePosition)
This method allows to add a certain weight to the sufficient statistic of a specific transition.

Parameters:
layer - the layer of the matrix
index - the index encoding the context
childIdx - the index of the child
weight - the weight added to the sufficient statistic
sequence - the sequence
sequencePosition - the position within the sequence

joinStatistics

void joinStatistics(Transition... transitions)
This method joins the statistics of different instances and sets this joined statistic as statistic of each instance. This method might be used for instance in a multi-threaded optimization to join partial statistics.

Parameters:
transitions - the transitions to be joined

getLogGammaScoreFromStatistic

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

Returns:
the logarithm of the gamma-score for the current statistics