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