def wp_powerlaw_model(self, rsep, r0, gamma): """ Power law model for wp(rp) assuming that xi = (r/r0)^-gamma. """ if rsep.any < 0.0: return np.inf return rsep * (rsep / r0)**(-gamma) * gammafn(0.5) * gammafn( (gamma - 1.0) / 2.0) / gammafn(gamma / 2.0)
def f(a, b, m): y = (np.arange(20000.) - 10000)/100 return gammafn(a+0.5) / (sqrt(4*pi*b) * gammafn(a)) * (1 + (y-m)**2/(4*b))**-(a+0.5)
def lik(a, b, m, y): return gammafn(a+0.5) / (sqrt(4*pi*b) * gammafn(a)) * (1 + (y-m)**2/(4*b))**-(a+0.5)
def p(t): return 0.25 * gammafn(10) / (gammafn(2) * gammafn(8)) * (3 * t * (1 - t)**7 + t**7 * (1 - t))
def lgamma(x): return gammafn(np.log(x))