'Calculates the gradient of a weighted empirical likelihood
problem
Parameters
eta : ndarray, (1,m)
Lagrange multiplier in the profile likelihood maximization
est_vect : ndarray, (n,k)
Estimating equations vector
weights : 1darray
Observation weights
Returns
gradient : ndarray (m,1)
The gradient used in _wtd_modif_newton'

def _grad(self, eta, est_vect, weights, nobs):

    data_star_prime = (np.sum(weights) + np.dot(est_vect, eta))
    idx = (data_star_prime < (1.0 / nobs))
    not_idx = (~ idx)
    data_star_prime[idx] = (nobs * (2 - (nobs * data_star_prime[idx])))
    data_star_prime[not_idx] = (1.0 / data_star_prime[not_idx])
    return np.dot((weights * data_star_prime), est_vect)
