def marginal_likelihood(self, data):
        mll = 0

        M = data["M"]
        Z = data["Z"]
        omega = data["omega"]
        kappa = data["kappa"]

        # Compute the kernel for Z_news
        Cvv  = self.kernel.K(Z, Z)
        Cvv +=  np.diag(1e-6 * np.ones(M))

        for k in xrange(self.K-1):
            sys.stdout.write(".")
            sys.stdout.flush()

            # The predictive mean and covariance are given by equations 2.22-2.24
            # of GPML by Rasmussen and Williams
            Cvvpo = Cvv + np.diag(omega[:,k])
            Lvvpo = np.linalg.cholesky(Cvvpo)

            # The "observations" are the effective mean of the Gaussian
            # likelihood given omega
            y = kappa[:,k] / omega[:,k] - self.mu[k]

            # First term is -1/2 y^T K_y^{-1} y
            x1 = solve_triangular(Lvvpo, y, lower=True)
            x2 = solve_triangular(Lvvpo.T, x1, lower=False)
            mll += -0.5 * y.T.dot(x2)

            # Second term: -1/2 log |K_y|
            mll += np.linalg.slogdet(Cvvpo)[1]

            # Third term: -M/2 log 2*pi
            mll += -M/2.0 * np.log(2*np.pi)

        return mll
Delete the cache keys associated with this model.
dataset/ETHPy150Open HIPS/pgmult/pgmult/gp.py/_MultinomialGPBase.marginal_likelihood--crossover with--dataset/ETHPy150Open edoburu/django-fluent-contents/fluent_contents/models/mixins.py/CachedModelMixin.clear_cache