def normgrad(y, x, params):
 beta = params[:(-1)]
 sigma2 = (params[(-1)] * np.ones((len(y), 1)))
 dmudbeta = mean_grad(x, beta)
 mu = np.dot(x, beta)
 params2 = np.column_stack((mu, sigma2))
 dllsdms = norm_lls_grad(y, params2)
 grad = np.column_stack(((dllsdms[:, :1] * dmudbeta), dllsdms[:, :1]))
 return grad

def normgrad ( y , x , params ) : beta = params [ : ( - 1 ) ] sigma2 = ( params [ ( - 1 ) ] * np . ones ( ( len ( y ) , 1 ) ) ) dmudbeta = mean_grad ( x , beta ) mu = np . dot ( x , beta ) params2 = np . column_stack ( ( mu , sigma2 ) ) dllsdms = norm_lls_grad ( y , params2 ) grad = np . column_stack ( ( ( dllsdms [ : , : 1 ] * dmudbeta ) , dllsdms [ : , : 1 ] ) ) return grad
jacobian of normal loglikelihood wrt mean mu and variance sigma2 parameters y : array .