treetime/clock_tree.py
def timetree_likelihood(self):
        '''
        Return the likelihood of the data given the current branch length in the tree
        '''
        LH = 0
        for node in self.tree.find_clades(order='preorder'):  # sum the likelihood contributions of all branches
            if node.up is None: # root node
                continue
            LH -= node.branch_length_interpolator(node.branch_length)

        # add the root sequence LH and return
        if self.aln:
            LH += self.gtr.sequence_logLH(self.tree.root.cseq, pattern_multiplicity=self.multiplicity)
        return LH
def timetree_likelihood(self):
        '''
        Return the likelihood of the data given the current branch length in the tree
        '''
        LH = 0
        for node in self.tree.find_clades(order='preorder'):  # sum the likelihood contributions of all branches
            if node.up is None: # root node
                continue
            LH -= node.branch_length_interpolator(node.branch_length)

        # add the root sequence LH and return
        if self.aln:
            LH += self.gtr.sequence_logLH(self.tree.root.cseq, pattern_multiplicity=self.multiplicity)
        return LH
def timetree_likelihood ( self ) : LH = 0 for node in self . tree . find_clades ( order = 'preorder' ) : # sum the likelihood contributions of all branches if node . up is None : # root node continue LH -= node . branch_length_interpolator ( node . branch_length ) # add the root sequence LH and return if self . aln : LH += self . gtr . sequence_logLH ( self . tree . root . cseq , pattern_multiplicity = self . multiplicity ) return LH
Return the likelihood of the data given the current branch length in the tree
Return the likelihood of the data given the current branch length in the tree