class_docstr: Compare the logp of models Marginal, sigma=0 and Latent.
class_docstr_tok: ["Compare","the","logp","of","models","Marginal",",","sigma=0","and","Latent","."]
code: def testLatent2(self):
      with pm.Model() as model:
          cov_func = pm.gp.cov.ExpQuad(3, [0.1, 0.2, 0.3])
          mean_func = pm.gp.mean.Constant(0.5)
          gp = pm.gp.Latent(mean_func=mean_func, cov_func=cov_func)
          f = gp.prior("f", self.X, reparameterize=True)
          p = gp.conditional("p", self.Xnew)
      assert tuple(f.shape.eval()) == (self.X.shape[0],)
      assert tuple(p.shape.eval()) == (self.Xnew.shape[0],)
      chol = np.linalg.cholesky(cov_func(self.X).eval())
      y_rotated = np.linalg.solve(chol, self.y - 0.5)
      latent_logp = model.compile_logp()(
          {"f_rotated_": y_rotated, "p": self.pnew}
      )
      npt.assert_allclose(latent_logp, self.logp, atol=5)
  
imports: from functools import reduce
  from operator import add
  import numpy
  import numpy.testing
  import pytest
  import pymc
  from pymc.math import cartesian
label_desc: Use image node_id 3 for calling the TestMarginalVsLatent obj's underlying member method code with example usage: obj.testLatent2() without return types