From 5dc09490cdfd9246e058ee485a5a780c5544d861 Mon Sep 17 00:00:00 2001 From: William Wilkinson Date: Fri, 18 Nov 2022 14:50:26 +0000 Subject: [PATCH] bug fix in heteroscedastic students t --- bayesnewton/likelihoods.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bayesnewton/likelihoods.py b/bayesnewton/likelihoods.py index 5858be1..e9d4bb5 100644 --- a/bayesnewton/likelihoods.py +++ b/bayesnewton/likelihoods.py @@ -1541,14 +1541,14 @@ def __init__(self, df, link='softplus'): def evaluate_log_likelihood(self, y, f): """ """ - mu, scale = self.conditional_moments(f) + mu, scale2 = self.conditional_moments(f) const = ( gammaln((self.df + 1.0) * 0.5) - gammaln(self.df * 0.5) - - 0.5 * (np.log(np.square(scale)) + np.log(self.df) + np.log(np.pi)) + - 0.5 * (np.log(scale2) + np.log(self.df) + np.log(np.pi)) ) return np.squeeze(const - 0.5 * (self.df + 1.0) * np.log( - 1.0 + (1.0 / self.df) * (np.square((y - mu) / scale)) + 1.0 + (1.0 / self.df) * (np.square(y - mu) / scale2) )) def conditional_moments(self, f, hyp=None):