Skip to content

Fix numerics of TruncatedNormal #3077

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

Merged
merged 2 commits into from
Jul 6, 2018
Merged

Conversation

aseyboldt
Copy link
Member

Support cases where lower or upper are None, and improve the numerical stability of logp.

@@ -87,6 +87,25 @@ def std_cdf(x):
return .5 + .5 * tt.erf(x / tt.sqrt(2.))


def normal_lcdf(mu, sigma, x):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Member

@junpenglao junpenglao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Minor comment please remove redundant code in example

@aseyboldt aseyboldt merged commit e29acd5 into pymc-devs:master Jul 6, 2018
@aseyboldt aseyboldt deleted the fix-truncnorm branch July 6, 2018 12:20
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.

2 participants