-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Closed
Labels
defectA clear bug or issue that prevents SciPy from being installed or used as expectedA clear bug or issue that prevents SciPy from being installed or used as expectedgood first issueGood topic for first contributor pull requests, with a relatively straightforward solutionGood topic for first contributor pull requests, with a relatively straightforward solutionscipy.stats
Milestone
Description
truncnorm does not check that a < b
. If b > a
, one can produce rvs but the pdf and cdf do not work.
Should be easy to fix using _argcheck
.
Reproducing code example:
from scipy import stats
import numpy as np
x = np.arange(1, 2, 0.1)
stats.truncnorm(2, 1).pdf(x) # all 0
stats.truncnorm(2, 1).cdf(1) # 1.0
stats.truncnorm(2, 1).cdf(0.999) # 0.0
stats.truncnorm(2, 1).rvs(size=5, random_state=123)
# array([1.1880652 , 1.54116815, 1.61108676, 1.29490424, 1.17234318])
This does not make sense.
Scipy/Numpy/Python version information:
1.0.0 1.14.1 sys.version_info(major=3, minor=5, micro=4, releaselevel='final', serial=0)
Metadata
Metadata
Assignees
Labels
defectA clear bug or issue that prevents SciPy from being installed or used as expectedA clear bug or issue that prevents SciPy from being installed or used as expectedgood first issueGood topic for first contributor pull requests, with a relatively straightforward solutionGood topic for first contributor pull requests, with a relatively straightforward solutionscipy.stats