<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def chi2_vals(self, x):
 """Compute the difference in the log-likelihood between the MLE in each energy bin and the normalization predicted by a global best-fit model. This array can be summed to get a goodness-of-fit chi2 for the model. Parameters x : `~numpy.ndarray` An array of normalizations derived from a global fit to all energy bins. Returns ------- chi2_vals : `~numpy.ndarray` An array of chi2 values for each energy bin. """


        chi2_vals = np.ndarray((self._nx))
        for i in range(self._nx):

            mle = self._loglikes[i].mle()
            nll0 = self._loglikes[i].interp(mle)
            nll1 = self._loglikes[i].interp(x[i])
            chi2_vals[i] = 2.0 * np.abs(nll0 - nll1)

        return chi2_vals