treetime/node_interpolator.py
def _evaluate_convolution(t_val, f, g,  n_integral = 100, inverse_time=None, return_log=False):
    """
    Calculate convolution F(t) = int { f(tau)g(t-tau) } dtau
    """

    FG = _convolution_integrand(t_val, f, g, inverse_time, return_log)

    #integrate the interpolation object, return log, make neg_log
        #print('FG:',FG.xmin, FG.xmax, FG(FG.xmin), FG(FG.xmax))
    if (return_log and FG == ttconf.BIG_NUMBER) or \
        (not return_log and FG == 0.0): # distributions do not overlap
        res = ttconf.BIG_NUMBER # we integrate log funcitons
    else:
        res = -FG.integrate(a=FG.xmin, b=FG.xmax, n=n_integral, return_log=True)

    if return_log:
        return res, -1
    else:
        return np.exp(-res), -1
def _evaluate_convolution(t_val, f, g,  n_integral = 100, inverse_time=None, return_log=False):
    """
    Calculate convolution F(t) = int { f(tau)g(t-tau) } dtau
    """

    FG = _convolution_integrand(t_val, f, g, inverse_time, return_log)

    #integrate the interpolation object, return log, make neg_log
        #print('FG:',FG.xmin, FG.xmax, FG(FG.xmin), FG(FG.xmax))
    if (return_log and FG == ttconf.BIG_NUMBER) or \
        (not return_log and FG == 0.0): # distributions do not overlap
        res = ttconf.BIG_NUMBER # we integrate log funcitons
    else:
        res = -FG.integrate(a=FG.xmin, b=FG.xmax, n=n_integral, return_log=True)

    if return_log:
        return res, -1
    else:
        return np.exp(-res), -1
def _evaluate_convolution ( t_val , f , g , n_integral = 100 , inverse_time = None , return_log = False ) : FG = _convolution_integrand ( t_val , f , g , inverse_time , return_log ) #integrate the interpolation object, return log, make neg_log #print('FG:',FG.xmin, FG.xmax, FG(FG.xmin), FG(FG.xmax)) if ( return_log and FG == ttconf . BIG_NUMBER ) or ( not return_log and FG == 0.0 ) : # distributions do not overlap res = ttconf . BIG_NUMBER # we integrate log funcitons else : res = - FG . integrate ( a = FG . xmin , b = FG . xmax , n = n_integral , return_log = True ) if return_log : return res , - 1 else : return np . exp ( - res ) , - 1
Calculate convolution F(t) = int { f(tau)g(t-tau) } dtau
Calculate convolution F ( t ) = int { f ( tau ) g ( t - tau ) } dtau