(self, theta)
Return the loglikelihood (+ the prior) for a hyperparameter
        configuration theta.

        Parameters
        ----------
        theta : np.ndarray(H)
            Hyperparameter vector. Note that all hyperparameter are
            on a log scale.

        Returns
        ----------
        float
            lnlikelihood + prior
Return the loglikelihood (+ the prior) for a hyperparameter
        configuration theta.
Return the loglikelihood ( + the prior ) for a hyperparameter configuration theta .
def loglikelihood(self, theta):
        """
        Return the loglikelihood (+ the prior) for a hyperparameter
        configuration theta.

        Parameters
        ----------
        theta : np.ndarray(H)
            Hyperparameter vector. Note that all hyperparameter are
            on a log scale.

        Returns
        ----------
        float
            lnlikelihood + prior
        """

        # Bound the hyperparameter space to keep things sane. Note all
        # hyperparameters live on a log scale
        if np.any((-20 > theta) + (theta > 20)):
            return -np.inf
            
        # The last entry is always the noise
        sigma_2 = np.exp(theta[-1])
        # Update the kernel and compute the lnlikelihood.
        self.gp.kernel.set_parameter_vector(theta[:-1])
        try:
            self.gp.compute(self.X, yerr=np.sqrt(sigma_2))
        except:
            return -np.inf

        if self.prior is not None:
            return self.prior.lnprob(theta) + self.gp.log_likelihood(self.y, quiet=True)
        else:
            return self.gp.log_likelihood(self.y, quiet=True)
def loglikelihood ( self , theta ) : # Bound the hyperparameter space to keep things sane. Note all # hyperparameters live on a log scale if np . any ( ( - 20 > theta ) + ( theta > 20 ) ) : return - np . inf # The last entry is always the noise sigma_2 = np . exp ( theta [ - 1 ] ) # Update the kernel and compute the lnlikelihood. self . gp . kernel . set_parameter_vector ( theta [ : - 1 ] ) try : self . gp . compute ( self . X , yerr = np . sqrt ( sigma_2 ) ) except : return - np . inf if self . prior is not None : return self . prior . lnprob ( theta ) + self . gp . log_likelihood ( self . y , quiet = True ) else : return self . gp . log_likelihood ( self . y , quiet = True )