Skip to content

Commit a804409

Browse files
ColCarrolljunpenglao
authored andcommitted
Fix typo in inverse gamma variance (#3228)
1 parent 6e9da82 commit a804409

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pymc3/distributions/continuous.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2399,7 +2399,7 @@ class InverseGamma(PositiveContinuous):
23992399
======== ======================================================
24002400
Support :math:`x \in (0, \infty)`
24012401
Mean :math:`\dfrac{\beta}{\alpha-1}` for :math:`\alpha > 1`
2402-
Variance :math:`\dfrac{\beta^2}{(\alpha-1)^2(\alpha)}`
2402+
Variance :math:`\dfrac{\beta^2}{(\alpha-1)^2(\alpha - 2)}`
24032403
for :math:`\alpha > 2`
24042404
======== ======================================================
24052405
@@ -2425,7 +2425,7 @@ def __init__(self, alpha=None, beta=None, mu=None, sd=None, *args, **kwargs):
24252425
self.mean = self._calculate_mean()
24262426
self.mode = beta / (alpha + 1.)
24272427
self.variance = tt.switch(tt.gt(alpha, 2),
2428-
(beta**2) / (alpha * (alpha - 1.)**2),
2428+
(beta**2) / ((alpha - 2) * (alpha - 1.)**2),
24292429
np.inf)
24302430
assert_negative_support(alpha, 'alpha', 'InverseGamma')
24312431
assert_negative_support(beta, 'beta', 'InverseGamma')

0 commit comments

Comments
 (0)