Skip to content

Commit

Permalink
MAINT: stats: update boost to improve skewnorm.ppf (#20643)
Browse files Browse the repository at this point in the history
* MAINT: stats: update boost to fix improve `skewnorm.ppf`
  • Loading branch information
dschmitz89 committed May 6, 2024
1 parent 1996658 commit ee8c655
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions scipy/stats/tests/test_distributions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4009,6 +4009,12 @@ 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_ppf(self):
# gh-20124 reported that Boost's ppf was wrong for high skewness
# Reference value was calculated using
# N[InverseCDF[SkewNormalDistribution[0, 1, 500], 1/100], 14] in Wolfram Alpha.
assert_allclose(stats.skewnorm.ppf(0.01, 500), 0.012533469508013, rtol=1e-13)


class TestExpon:
def test_zero(self):
Expand Down

0 comments on commit ee8c655

Please sign in to comment.