def logp(self, F, Y): mean = self.invlink(F) alpha = mean * self.scale beta = self.scale - alpha return logdensities.beta(Y, alpha, beta)
def test_beta(x, alpha, beta): gpf = logdensities.beta(x, alpha, beta).numpy() sps = scipy.stats.beta(a=alpha, b=beta).logpdf(x) np.testing.assert_allclose(gpf, sps)