code: def testAdditiveLatent(self):
      with pm.Model() as model1:
          gp1 = pm.gp.Latent(
              mean_func=self.means[0], cov_func=self.covs[0]
          )
          gp2 = pm.gp.Latent(
              mean_func=self.means[1], cov_func=self.covs[1]
          )
          gp3 = pm.gp.Latent(
              mean_func=self.means[2], cov_func=self.covs[2]
          )
  
          gpsum = gp1 + gp2 + gp3
          fsum = gpsum.prior("fsum", self.X, reparameterize=False)
          model1_logp = model1.compile_logp()({"fsum": self.y})
  
      with pm.Model() as model2:
          gptot = pm.gp.Latent(
              mean_func=reduce(add, self.means),
              cov_func=reduce(add, self.covs),
          )
          fsum = gptot.prior("fsum", self.X, reparameterize=False)
          model2_logp = model2.compile_logp()({"fsum": self.y})
      npt.assert_allclose(model1_logp, model2_logp, atol=0, rtol=1e-2)
  
      with model1:
          fp1 = gpsum.conditional(
              "fp1",
              self.Xnew,
              given={"X": self.X, "f": self.y, "gp": gpsum},
          )
      with model2:
          fp2 = gptot.conditional("fp2", self.Xnew)
  
      fp = np.random.randn(self.Xnew.shape[0])
      logp1 = model1.compile_logp()({"fsum": self.y, "fp1": fp})
      logp2 = model2.compile_logp()({"fsum": self.y, "fp2": fp})
      npt.assert_allclose(logp1, logp2, atol=0, rtol=1e-2)
  
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 4 for calling the TestGPAdditive obj's underlying member method code with example usage: obj.testAdditiveLatent() without return types