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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use more numerically stable function in TruncatedNormal area computation #7305

Merged
merged 1 commit into from May 21, 2024

Conversation

velochy
Copy link
Contributor

@velochy velochy commented May 9, 2024

Description

Replace the complex logic for area computation in TruncateNormal with a single, more numerically stable function meant for exactly that computation.

Related Issue

This is mainly code cleanup, although I did run into a few cases where it actually improves convergence.

Checklist

Type of change

  • Maintenance

馃摎 Documentation preview 馃摎: https://pymc--7305.org.readthedocs.build/en/7305/

@ricardoV94
Copy link
Member

can you add a test that checks the improved stability (and would fail before the changes)?

@velochy
Copy link
Contributor Author

velochy commented May 9, 2024

I tried. Turns out to not be easy to condense down to a simple example.
Isn't the code cleanup aspect here enough?

@ricardoV94 ricardoV94 requested a review from aseyboldt May 16, 2024 12:46
@ricardoV94 ricardoV94 changed the title Use more numerically stable function in TruncateNormal area computation Use more numerically stable function in TruncatedNormal area computation May 16, 2024
@ricardoV94 ricardoV94 merged commit fd11cf0 into pymc-devs:main May 21, 2024
19 of 21 checks passed
@ricardoV94
Copy link
Member

Thanks @velochy

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

Successfully merging this pull request may close these issues.

None yet

2 participants