Skip to content

Commit dadd81a

Browse files
committed
Added test
1 parent c963acf commit dadd81a

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

pymc/tests/test_distributions_moments.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
Triangular,
5555
TruncatedNormal,
5656
Uniform,
57+
VonMises,
5758
Wald,
5859
Weibull,
5960
ZeroInflatedBinomial,
@@ -437,6 +438,20 @@ def test_pareto_moment(alpha, m, size, expected):
437438
Pareto("x", alpha=alpha, m=m, size=size)
438439
assert_moment_is_expected(model, expected)
439440

441+
@pytest.mark.parametrize(
442+
"mu, kappa, size, expected",
443+
[
444+
(0, 1, None, 0),
445+
(0, np.ones(4), None, np.zeros(4)),
446+
(np.arange(4), 0.5, None, np.arange(4)),
447+
(np.arange(4), np.arange(1, 5), (2, 4), np.full((2, 4), np.arange(4))),
448+
],
449+
)
450+
def test_vonmises_moment(mu, kappa, size, expected):
451+
with Model() as model:
452+
VonMises("x", mu=mu, kappa=kappa, size=size)
453+
assert_moment_is_expected(model, expected)
454+
440455

441456
@pytest.mark.parametrize(
442457
"mu, lam, phi, size, expected",

0 commit comments

Comments
 (0)