(self, k=1, m=1)
return bic
Returns the Bayesian Information Criterion
            assuming a k-th order Markov model
Returns the Bayesian Information Criterion
            assuming a k-th order Markov model
Returns the Bayesian Information Criterion assuming a k - th order Markov model
def getBIC(self, k=1, m=1):
        """ Returns the Bayesian Information Criterion
            assuming a k-th order Markov model """

        if k not in self.P:
            self.fitMarkovModel(k)

        if m not in self.P:
            self.fitMarkovModel(m)

        L_k = self.getLikelihood(k, log=True)
        L_m = self.getLikelihood(m, log=True)

        s = len(self.states[1])
        n = len(self.sequence)-k

        # the transition matrix of a first-order model with s states has s**2 entries, subject to the
        # constraint that entries in each row must sum up to one (thus effectively reducing
        # the degrees of freedom by a factor of s, i.e. we have s**2-s**1. Generalizing this to order k,
        # we arrive at s**k * (s-1) = s**(k+1) - s**k derees of freedom
        bic = _np.log(n) * (s**k - s**m) * (s-1) - 2.0 * (L_k-L_m)

        return bic
def getBIC ( self , k = 1 , m = 1 ) : if k not in self . P : self . fitMarkovModel ( k ) if m not in self . P : self . fitMarkovModel ( m ) L_k = self . getLikelihood ( k , log = True ) L_m = self . getLikelihood ( m , log = True ) s = len ( self . states [ 1 ] ) n = len ( self . sequence ) - k # the transition matrix of a first-order model with s states has s**2 entries, subject to the # constraint that entries in each row must sum up to one (thus effectively reducing # the degrees of freedom by a factor of s, i.e. we have s**2-s**1. Generalizing this to order k, # we arrive at s**k * (s-1) = s**(k+1) - s**k derees of freedom bic = _np . log ( n ) * ( s ** k - s ** m ) * ( s - 1 ) - 2.0 * ( L_k - L_m ) return bic