<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def batch_update(self, outcomes, expparams, resample_interval=5):
 r""" Updates based on a batch of outcomes and experiments, rather than just one. :param numpy.ndarray outcomes: An array of outcomes of the experiments that were performed. :param numpy.ndarray expparams: Either a scalar or record single-index array of experiments that were performed. :param int resample_interval: Controls how often to check whether :math:`N_{\text{ess}}` falls below the resample threshold. """


        # TODO: write a faster implementation here using vectorized calls to
        #       likelihood.

        # Check that the number of outcomes and experiments is the same.
        n_exps = outcomes.shape[0]
        if expparams.shape[0] != n_exps:
            raise ValueError("The number of outcomes and experiments must match.")

        if len(expparams.shape) == 1:
            expparams = expparams[:, None]

        # Loop over experiments and update one at a time.
        for idx_exp, (outcome, experiment) in enumerate(zip(iter(outcomes), iter(expparams))):
            self.update(outcome, experiment, check_for_resample=False)
            if (idx_exp + 1) % resample_interval == 0:
                self._maybe_resample()