Skip to content

Fix for divide by zero in psislw call from Pathfinder#674

Closed
fonnesbeck wants to merge 1 commit intopymc-devs:mainfrom
fonnesbeck:divby0_fix
Closed

Fix for divide by zero in psislw call from Pathfinder#674
fonnesbeck wants to merge 1 commit intopymc-devs:mainfrom
fonnesbeck:divby0_fix

Conversation

@fonnesbeck
Copy link
Copy Markdown
Member

This is intended to fix the divide by zero issue by wrapping logiw in xr.DataArray with dims="__sample__" before calling psislw. This is the documented-recommended input form per arviz's own psislw docstring.

Regression test added.

@jessegrabowski
Copy link
Copy Markdown
Member

jessegrabowski commented Apr 19, 2026

We need this to target the v0.11 branch on my fork of pymc-extras here . @ricardoV94 refused to help me figure out how to set up things like on pymc/pytensor to auto-target it, and I am playing helpless in order to complain for comedic effect.

This won't work on main because we're not cut over to arviz 1.0 yet, so CI will fail.

@aloctavodia
Copy link
Copy Markdown
Member

az.psislw doesn't exist anymore on its own. Currently, that function should be used as an accessor (as already done in #668 ) or from the array_stats interface. I added a guard here arviz-devs/arviz-stats@bee3891. The test should pass then, as the _gpd_fit function should return np.nan, np.nan instead of getting into the divide by zero part.

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.

3 participants