The function that gets passed to the optimizers.

def func(self, p):
        """
        The function that gets passed to the optimizers.
        """
        self._set_stochastics(p)
        try:
            return -1. * self.logp
        except ZeroProbability:
            return Inf