Beispiel #1
0
 def makeQdDefn(self, word_probs, mprobs_matrix, rate_params):
     expm = NonParamDefn('expm')
     exp = ExpDefn(expm)
     calcExMat = CalcDefn(lambda: self.calcExchangeabilityMatrix,
                          name='calculate_exchangeability_matrix')()
     Qd = CalcDefn(CalcQd, name='Qd')(exp, calcExMat, word_probs,
                                      mprobs_matrix, *rate_params)
     return Qd
Beispiel #2
0
 def makeQdDefn(self, word_probs, mprobs_matrix, rate_params):
     """Diagonalized Q, ie: rate matrix prepared for exponentiation"""
     Q = CalcDefn(self.calcQ, name='Q')(word_probs, mprobs_matrix, *rate_params)
     expm = NonParamDefn('expm')
     exp = ExpDefn(expm)
     Qd = CallDefn(exp, Q, name='Qd')
     return Qd
Beispiel #3
0
 def makeContinuousPsubDefn(self, word_probs, mprobs_matrix, distance,
                            rate_params):
     Qd = self.makeQdDefn(word_probs, mprobs_matrix, rate_params)
     Q = CalcDefn(lambda cQd, t: cQd.getQ(t), name='Q')(Qd, distance)
     P = CalcDefn(lambda cQd, Q: cQd.getP(), name='psubs')(Qd, Q)
     return P