(self, theta)
return mll
Log likelihood of the data marginalised over the weights w. See chapter 3.5 of
        the book by Bishop of an derivation.

        Parameters
        ----------
        theta: np.array(2,)
            The hyperparameter alpha and beta on a log scale

        Returns
        -------
        float
            lnlikelihood + prior
Log likelihood of the data marginalised over the weights w. See chapter 3.5 of
        the book by Bishop of an derivation.
Log likelihood of the data marginalised over the weights w . See chapter 3 . 5 of the book by Bishop of an derivation .
def marginal_log_likelihood(self, theta):
        """
        Log likelihood of the data marginalised over the weights w. See chapter 3.5 of
        the book by Bishop of an derivation.

        Parameters
        ----------
        theta: np.array(2,)
            The hyperparameter alpha and beta on a log scale

        Returns
        -------
        float
            lnlikelihood + prior
        """

        # Theta is on a log scale
        alpha = np.exp(theta[0])
        beta = np.exp(theta[1])

        D = self.X_transformed.shape[1]
        N = self.X_transformed.shape[0]

        A = beta * np.dot(self.X_transformed.T, self.X_transformed)
        A += np.eye(self.X_transformed.shape[1]) * alpha
        A_inv = np.linalg.inv(A)
        m = beta * np.dot(A_inv, self.X_transformed.T)
        m = np.dot(m, self.y)

        mll = D / 2 * np.log(alpha)
        mll += N / 2 * np.log(beta)
        mll -= N / 2 * np.log(2 * np.pi)
        mll -= beta / 2. * np.linalg.norm(self.y - np.dot(self.X_transformed, m), 2)
        mll -= alpha / 2. * np.dot(m.T, m)
        mll -= 0.5 * np.log(np.linalg.det(A))

        if self.prior is not None:
            mll += self.prior.lnprob(theta)

        return mll
def marginal_log_likelihood ( self , theta ) : # Theta is on a log scale alpha = np . exp ( theta [ 0 ] ) beta = np . exp ( theta [ 1 ] ) D = self . X_transformed . shape [ 1 ] N = self . X_transformed . shape [ 0 ] A = beta * np . dot ( self . X_transformed . T , self . X_transformed ) A += np . eye ( self . X_transformed . shape [ 1 ] ) * alpha A_inv = np . linalg . inv ( A ) m = beta * np . dot ( A_inv , self . X_transformed . T ) m = np . dot ( m , self . y ) mll = D / 2 * np . log ( alpha ) mll += N / 2 * np . log ( beta ) mll -= N / 2 * np . log ( 2 * np . pi ) mll -= beta / 2. * np . linalg . norm ( self . y - np . dot ( self . X_transformed , m ) , 2 ) mll -= alpha / 2. * np . dot ( m . T , m ) mll -= 0.5 * np . log ( np . linalg . det ( A ) ) if self . prior is not None : mll += self . prior . lnprob ( theta ) return mll