def tstd_lls(y, params, df):
 (mu, sigma2) = params.T
 df = (df * 1.0)
 lls = ((gammaln(((df + 1) / 2.0)) - gammaln((df / 2.0))) - (0.5 * np.log(((df - 2) * np.pi))))
 lls -= ((((df + 1) / 2.0) * np.log((1.0 + ((((y - mu) ** 2) / (df - 2)) / sigma2)))) + (0.5 * np.log(sigma2)))
 return lls

def tstd_lls ( y , params , df ) : ( mu , sigma2 ) = params . T df = ( df * 1.0 ) lls = ( ( gammaln ( ( ( df + 1 ) / 2.0 ) ) - gammaln ( ( df / 2.0 ) ) ) - ( 0.5 * np . log ( ( ( df - 2 ) * np . pi ) ) ) ) lls -= ( ( ( ( df + 1 ) / 2.0 ) * np . log ( ( 1.0 + ( ( ( ( y - mu ) ** 2 ) / ( df - 2 ) ) / sigma2 ) ) ) ) + ( 0.5 * np . log ( sigma2 ) ) ) return lls
t loglikelihood given observations and mean mu and variance sigma2 = 1 parameters y : array .