Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: non-extreme truncnorm tails #2494

Merged
merged 4 commits into from May 19, 2013
Merged

Conversation

argriffing
Copy link
Contributor

The truncnorm distribution has two numerical problems. The first problem is that it cannot deal at all with extreme tails, such as x=1000. The second problem is that its implementation does not use the symmetry of the normal distribution as much as it could, resulting in higher precision for negative tails where the cdf is near epsilon, and lower precision for positive tails where the cdf is near 1-epsilon. This is related to pv's comment #2477 (comment).

This PR addresses only the second of these two problems. It should close or partially close the issues #1489 and #2477.

@josef-pkt
Copy link
Member

Looks very nice,

you could add a new test case that handles this for a>0
['truncnorm', (0.1, 2.)],
https://github.com/scipy/scipy/blob/master/scipy/stats/tests/test_continuous_basic.py#L117

this will run a set of unit tests for this case

@argriffing
Copy link
Contributor Author

you could add a new test case

Added.

rgommers added a commit that referenced this pull request May 19, 2013
BUG: fix non-symmetry in tails of stats.truncnorm distribution.
@rgommers rgommers merged commit 5db3b49 into scipy:master May 19, 2013
@rgommers
Copy link
Member

Looks good, merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants