Skip to content

Commit

Permalink
add test for prior when there is an unaccounted uncertainty
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew McCluskey committed Feb 25, 2020
1 parent fff2fb0 commit 40fef12
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions uravu/tests/test_relationship.py
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,36 @@ def test_prior(self):
True,
)

def test_prior_b(self):
"""
Test prior function with unaccounted uncertainty.
"""
test_x = np.linspace(0, 99, 100)
test_y = np.linspace(1, 199, 100)
test_y_e = test_y * 0.1
test_rel = Relationship(utils.straight_line, test_x, test_y, test_y_e, unaccounted_uncertainty=True)
test_rel.max_likelihood()
result_priors = test_rel.prior()
assert_equal(len(result_priors), 3)
assert_equal(
isinstance(
result_priors[0], scipy.stats._distn_infrastructure.rv_frozen
),
True,
)
assert_equal(
isinstance(
result_priors[1], scipy.stats._distn_infrastructure.rv_frozen
),
True,
)
assert_equal(
isinstance(
result_priors[2], scipy.stats._distn_infrastructure.rv_frozen
),
True,
)

def test_mcmc(self):
"""
Test mcmc function.
Expand Down

0 comments on commit 40fef12

Please sign in to comment.