Skip to content

Commit

Permalink
TST: Add CDF-PPF roundtrip check for skewnorm
Browse files Browse the repository at this point in the history
This is a regression test for scipygh-20124.
  • Loading branch information
maresb committed Feb 21, 2024
1 parent cd9d20b commit b905486
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions scipy/stats/tests/test_distributions.py
Original file line number Diff line number Diff line change
Expand Up @@ -3978,6 +3978,13 @@ def optimizer(fun, bounds):
fit_result = stats.fit(stats.skewnorm, x, bounds, optimizer=optimizer)
np.testing.assert_allclose(params, fit_result.params, rtol=1e-4)

def test_cdf_ppf_roundtrip_gh20124(self):
x0 = 0.02
skew = 500
q = stats.skewnorm.cdf(x0, skew, 0, 1)
x1 = stats.skewnorm.ppf(q, skew, 0, 1)
assert_almost_equal(x1, x0)


class TestExpon:
def test_zero(self):
Expand Down

0 comments on commit b905486

Please sign in to comment.