-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Restrict domain on alpha in the CAR distribution #6801
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
1f00345
835f533
eba76f6
26859b1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -835,6 +835,23 @@ def test_car_matrix_check(sparse): | |||||
car_dist = pm.CAR.dist(mu, W, alpha, tau) | ||||||
|
||||||
|
||||||
@pytest.mark.parametrize("alpha", [1, -1]) | ||||||
def test_car_alpha(alpha): | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
""" | ||||||
Tests the check that -1 < alpha < 1 | ||||||
""" | ||||||
|
||||||
W = np.array([[0, 1, 0], [1, 0, 1], [0, 1, 0]]) | ||||||
|
||||||
tau = 1 | ||||||
mu = np.array([0, 0, 0]) | ||||||
|
||||||
car_dist = pm.CAR.dist(W=W, alpha=alpha, mu=mu, tau=tau) | ||||||
|
||||||
with pytest.raises(ValueError, match="the domain of alpha is: -1 < alpha < 1"): | ||||||
pm.draw(car_dist) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe worth to test the logp as well? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah I think so too. Is it okay if I write it within the same test or do we need two separate ones? I went with putting them in the same test with the latest commit but happy to reorganize it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think either is OK, it's clear what you're testing either way |
||||||
|
||||||
|
||||||
class TestLKJCholeskCov: | ||||||
def test_dist(self): | ||||||
sd_dist = pm.Exponential.dist(1, size=(10, 3)) | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume you mean this?