def evaluate(self, meanfunc, covfunc, likfunc, x, y, nargout=1):
        if not isinstance(likfunc, lik.Gauss):
            raise Exception ('Exact inference only possible with Gaussian likelihood')
        n, D = x.shape
        K = covfunc.getCovMatrix(x=x, mode='train')            # evaluate covariance matrix
        m = meanfunc.getMean(x)                                # evaluate mean vector

        sn2   = np.exp(2*likfunc.hyp[0])                       # noise variance of likGauss
        #L     = np.linalg.cholesky(K/sn2+np.eye(n)).T         # Cholesky factor of covariance with noise
        L     = jitchol(old_div(K,sn2)+np.eye(n)).T            # Cholesky factor of covariance with noise
        alpha = old_div(solve_chol(L,y-m),sn2)
        post = postStruct()
        post.alpha = alpha                                     # return the posterior parameters
        post.sW    = old_div(np.ones((n,1)),np.sqrt(sn2))               # sqrt of noise precision vector
        post.L     = L                                         # L = chol(eye(n)+sW*sW'.*K)

        if nargout>1:                                          # do we want the marginal likelihood?
            nlZ = old_div(np.dot((y-m).T,alpha),2.) + np.log(np.diag(L)).sum() + n*np.log(2*np.pi*sn2)/2. # -log marg lik
            if nargout>2:                                      # do we want derivatives?
                dnlZ = dnlZStruct(meanfunc, covfunc, likfunc)  # allocate space for derivatives
                Q = old_div(solve_chol(L,np.eye(n)),sn2) - np.dot(alpha,alpha.T) # precompute for convenience
                dnlZ.lik = [sn2*np.trace(Q)]
                if covfunc.hyp:
                    for ii in range(len(covfunc.hyp)):
                        dnlZ.cov[ii] = old_div((Q*covfunc.getDerMatrix(x=x, mode='train', der=ii)).sum(),2.)
                if meanfunc.hyp:
                    for ii in range(len(meanfunc.hyp)):
                        dnlZ.mean[ii] = np.dot(-meanfunc.getDerMatrix(x, ii).T,alpha)
                        dnlZ.mean[ii] = dnlZ.mean[ii][0,0]
                return post, nlZ[0,0], dnlZ
            return post, nlZ[0,0]
        return post
dataset/ETHPy150Open marionmari/pyGPs/pyGPs/Core/inf.py/Exact.evaluate/original