|
39 | 39 | KroneckerNormal,
|
40 | 40 | Kumaraswamy,
|
41 | 41 | Laplace,
|
| 42 | + LKJCorr, |
42 | 43 | Logistic,
|
43 | 44 | LogitNormal,
|
44 | 45 | LogNormal,
|
45 | 46 | MatrixNormal,
|
46 | 47 | Moyal,
|
47 | 48 | Multinomial,
|
| 49 | + MvNormal, |
48 | 50 | MvStudentT,
|
49 | 51 | NegativeBinomial,
|
50 | 52 | Normal,
|
|
68 | 70 | )
|
69 | 71 | from pymc.distributions.distribution import _get_moment, get_moment
|
70 | 72 | from pymc.distributions.logprob import joint_logpt
|
71 |
| -from pymc.distributions.multivariate import MvNormal |
72 | 73 | from pymc.distributions.shape_utils import rv_size_is_none, to_tuple
|
73 | 74 | from pymc.initial_point import make_initial_point_fn
|
74 | 75 | from pymc.model import Model
|
@@ -97,7 +98,6 @@ def test_all_distributions_have_moments():
|
97 | 98 |
|
98 | 99 | # Distributions that have not been refactored for V4 yet
|
99 | 100 | not_implemented = {
|
100 |
| - dist_module.multivariate.LKJCorr, |
101 | 101 | dist_module.mixture.Mixture,
|
102 | 102 | dist_module.mixture.MixtureSameFamily,
|
103 | 103 | dist_module.mixture.NormalMixture,
|
@@ -1424,3 +1424,18 @@ def test_kronecker_normal_moments(mu, covs, size, expected):
|
1424 | 1424 | with Model() as model:
|
1425 | 1425 | KroneckerNormal("x", mu=mu, covs=covs, size=size)
|
1426 | 1426 | assert_moment_is_expected(model, expected)
|
| 1427 | + |
| 1428 | + |
| 1429 | +@pytest.mark.parametrize( |
| 1430 | + "n, eta, size, expected", |
| 1431 | + [ |
| 1432 | + (3, 1, None, np.zeros(3)), |
| 1433 | + (5, 1, None, np.zeros(10)), |
| 1434 | + (3, 1, 1, np.zeros((1, 3))), |
| 1435 | + (5, 1, (2, 3), np.zeros((2, 3, 10))), |
| 1436 | + ], |
| 1437 | +) |
| 1438 | +def test_lkjcorr_moment(n, eta, size, expected): |
| 1439 | + with Model() as model: |
| 1440 | + LKJCorr("x", n=n, eta=eta, size=size) |
| 1441 | + assert_moment_is_expected(model, expected) |
0 commit comments