Skip to content

Commit

Permalink
bug fix in heteroscedastic students t
Browse files Browse the repository at this point in the history
  • Loading branch information
William Wilkinson committed Nov 18, 2022
1 parent e751f53 commit 5dc0949
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bayesnewton/likelihoods.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 5dc0949

Please sign in to comment.