Skip to content

Commit

Permalink
Add entropy for InverseGamma distribution.
Browse files Browse the repository at this point in the history
  • Loading branch information
tillahoffmann committed May 14, 2024
1 parent fc19783 commit 7522827
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions numpyro/distributions/continuous.py
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,14 @@ def variance(self):
def cdf(self, x):
return 1 - self.base_dist.cdf(1 / x)

def entropy(self):
return (
self.concentration
- jnp.log(self.rate)
+ gammaln(self.concentration)
- (1 + self.concentration) * digamma(self.concentration)
)


class Gompertz(Distribution):
r"""Gompertz Distribution.
Expand Down

0 comments on commit 7522827

Please sign in to comment.