Trees  Indices  Help 



object +  AbstractDPAlgorithms
An abstract class to calculate forward and backward probabilities.
This class should not be instantiated directly, but should be used through a derived class which implements proper scaling of variables.
This class is just meant to encapsulate the basic forward and backward algorithms, and allow derived classes to deal with the problems of multiplying probabilities.
Derived class of this must implement:
o _forward_recursion  Calculate the forward values in the recursion using some kind of technique for preventing underflow errors.
o _backward_recursion  Calculate the backward values in the recursion step using some technique to prevent underflow errors.












Inherited from 


Inherited from 

Initialize to calculate forward and backward probabilities. Arguments: o markov_model  The current Markov model we are working with. o sequence  A training sequence containing a set of emissions.

Calculate sequence probability using the forward algorithm. This implements the forward algorithm, as described on p5758 of Durbin et al. Returns: o A dictionary containing the forward variables. This has keys of the form (state letter, position in the training sequence), and values containing the calculated forward variable. o The calculated probability of the sequence. 
Calculate sequence probability using the backward algorithm. This implements the backward algorithm, as described on p5859 of Durbin et al. Returns: o A dictionary containing the backwards variables. This has keys of the form (state letter, position in the training sequence), and values containing the calculated backward variable. 
Trees  Indices  Help 


Generated by Epydoc 3.0.1 on Thu Aug 25 13:15:06 2016  http://epydoc.sourceforge.net 