def norm_lls_grad(y, params):
 (mu, sigma2) = params.T
 dllsdmu = ((y - mu) / sigma2)
 dllsdsigma2 = (((((y - mu) ** 2) / sigma2) - 1) / np.sqrt(sigma2))
 return np.column_stack((dllsdmu, dllsdsigma2))

def norm_lls_grad ( y , params ) : ( mu , sigma2 ) = params . T dllsdmu = ( ( y - mu ) / sigma2 ) dllsdsigma2 = ( ( ( ( ( y - mu ) ** 2 ) / sigma2 ) - 1 ) / np . sqrt ( sigma2 ) ) return np . column_stack ( ( dllsdmu , dllsdsigma2 ) )
jacobian of normal loglikelihood wrt mean mu and variance sigma2 parameters y : array .