def PDF(self,x): if (x <= 0.0): return 0.0 elif (x == 0) and (self.d1 < 2.0): return float("inf") elif (x == 0) and (self.d1 == 2.0): return 1.0 else: num_arg1 = pow(self.d1/self.d2, self.d1/2.0) num_arg2 = pow(x, (self.d1/2.0)-1.0) den_arg1 = math.exp(logBetaFunction(self.d1/2.0, self.d2/2.0)) den_arg2 = pow((1.0 + (self.d1*x)/self.d2), (self.d1 + self.d2)/2.0) return (num_arg1*num_arg2)/(den_arg1*den_arg2)
def PDF(self, x): term1 = 1.0/(math.sqrt(self.df) * math.exp(logBetaFunction(0.5, self.df/2.0))) term2 = pow(1.0 + (x*x/self.df), -(self.df + 1.0)/2.0) return term1 * term2