def locscale_grad(y, loc, scale, dlldy, *args):
 yst = ((y - loc) / scale)
 dlldloc = ((- dlldy(yst, *args)) / scale)
 dlldscale = (((-1.0) / scale) - ((dlldy(yst, *args) * (y - loc)) / (scale ** 2)))
 return (dlldloc, dlldscale)

def locscale_grad ( y , loc , scale , dlldy , * args ) : yst = ( ( y - loc ) / scale ) dlldloc = ( ( - dlldy ( yst , * args ) ) / scale ) dlldscale = ( ( ( - 1.0 ) / scale ) - ( ( dlldy ( yst , * args ) * ( y - loc ) ) / ( scale ** 2 ) ) ) return ( dlldloc , dlldscale )
derivative of log-likelihood with respect to location and scale parameters y : array_like data points of random variable at which loglike is evaluated loc : float location parameter of distribution scale : float scale parameter of distribution dlldy : function derivative of loglikelihood fuction wrt .