docstr: Make sure that the bordered system solves match the naive solution.
docstr_tok: ["Make","sure","that","the","bordered","system","solves","match","the","naive","solution","."]
code: def test_check_bordered_system(self):
      """Make sure that the bordered system solves match the naive solution."""
      n = 5
      # Compute the pseudo-likelihood via the bordered systems in O(n^3)
      train_x, train_y, loocv = self.get_data(
          [n, 2], dtype=torch.float64
      )
      output = loocv.model(train_x)
      loocv_1 = loocv(output, train_y)
  
      # Compute the pseudo-likelihood by fitting n independent models O(n^4)
      loocv_2 = 0.0
      for i in range(n):
          inds = torch.cat((torch.arange(0, i), torch.arange(i + 1, n)))
          likelihood = gpytorch.likelihoods.GaussianLikelihood()
          model = ExactGPModel(
              train_x[inds, :], train_y[inds], likelihood
          )
          model.eval()
          with torch.no_grad():
              preds = likelihood(model(train_x[i, :].unsqueeze(0)))
              mean, var = preds.mean, preds.variance
              loocv_2 += (
                  -0.5 * var.log()
                  - 0.5 * (train_y[i] - mean).pow(2.0) / var
                  - 0.5 * math.log(2 * math.pi)
              )
      loocv_2 /= n
  
      self.assertAlmostEqual(
          loocv_1.item(),
          loocv_2.item(),
      )
  
file_path: gpytorch/test/mlls/test_leave_one_out_pseudo_likelihood.py
imports: import math
  import unittest
  import torch
  import gpytorch
label_desc: Use image node_id 4 for calling the TestLeaveOneOutPseudoLikelihood obj's underlying member method code with example usage: obj.test_check_bordered_system() without return types