Skip to content

Commit

Permalink
Added _sf function again to argus distribution and added unittests
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaskeck committed Nov 19, 2016
1 parent 49596bb commit b851f3f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion scipy/stats/_continuous_distns.py
Original file line number Diff line number Diff line change
Expand Up @@ -5253,7 +5253,13 @@ def _cdf(self, x, chi):
"""
Return CDF of the argus function
"""
return 1.0 - _argus_phi(chi * np.sqrt(1 - x**2)) / _argus_phi(chi)
return 1.0 - self._sf(x, chi)

def _sf(self, x, chi):
"""
Return survival function of the argus function
"""
return _argus_phi(chi * np.sqrt(1 - x**2)) / _argus_phi(chi)
argus = argus_gen(name='argus', longname="An Argus Function", a=0.0, b=1.0)


Expand Down
1 change: 1 addition & 0 deletions scipy/stats/tests/test_distributions.py
Original file line number Diff line number Diff line change
Expand Up @@ -3021,6 +3021,7 @@ def test_argus_function():

for i in range(1, 10):
assert_equal(stats.argus.cdf(1.0, chi=i), 1.0)
assert_equal(stats.argus.cdf(1.0, chi=i), 1.0 - stats.argus.sf(1.0, chi=i))


if __name__ == "__main__":
Expand Down

0 comments on commit b851f3f

Please sign in to comment.