Skip to content

Commit c9e5a02

Browse files
committed
Forgot to include MoM in tests
1 parent 23bcaff commit c9e5a02

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/test_approximations.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,18 @@
4444
]
4545

4646

47+
def approximate_gamma_mom(mean, variance):
48+
"""
49+
Use the method of moments to approximate a distribution with a gamma of the
50+
same mean and variance
51+
"""
52+
assert mean > 0
53+
assert variance > 0
54+
alpha = mean**2 / variance
55+
beta = mean / variance
56+
return alpha, beta
57+
58+
4759
@pytest.mark.parametrize("pars", _gamma_trio_test_cases)
4860
class TestPosteriorMomentMatching:
4961
"""

0 commit comments

Comments
 (0)