code: def _objective(self, x):
          
          try:
              self.optimizer_array = x
              obj = self.objective_function()
              self._fail_count = 0
          except (LinAlgError, ZeroDivisionError, ValueError):#pragma: no cover
              if self._fail_count >= self._allowed_failures:
                  raise
              self._fail_count += 1
              return np.inf
          return obj
docs: The objective function passed to the optimizer. It combines
          the likelihood and the priors.
  
          Failures are handled robustly. The algorithm will try several times to
          return the objective, and will raise the original exception if
          the objective cannot be computed.
  
          :param x: the parameters of the model.
          :parameter type: np.array