<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def derivative(self, x, der=1):
 """Return the derivate of the log-like summed over the energy bins Parameters x : `~numpy.ndarray` Array of N x M values der : int Order of the derivate Returns ------- der_val : `~numpy.ndarray` Array of negative log-likelihood values. """

        if len(x.shape) == 1:
            der_val = np.zeros((1))
        else:
            der_val = np.zeros((x.shape[1:]))

        for i, xv in enumerate(x):
            der_val += self._loglikes[i].interp.derivative(xv, der=der)
        return der_val