def tstd_pdf(x, df):
 r = np.array((df * 1.0))
 Px = (np.exp((special.gammaln(((r + 1) / 2.0)) - special.gammaln((r / 2.0)))) / np.sqrt(((r - 2) * pi)))
 Px /= ((1 + ((x ** 2) / (r - 2))) ** ((r + 1) / 2.0))
 return Px

def tstd_pdf ( x , df ) : r = np . array ( ( df * 1.0 ) ) Px = ( np . exp ( ( special . gammaln ( ( ( r + 1 ) / 2.0 ) ) - special . gammaln ( ( r / 2.0 ) ) ) ) / np . sqrt ( ( ( r - 2 ) * pi ) ) ) Px /= ( ( 1 + ( ( x ** 2 ) / ( r - 2 ) ) ) ** ( ( r + 1 ) / 2.0 ) ) return Px
pdf for standardized t distribution .