Skip to content

Fix bug in fit_laplace when model has exactly one variable #437

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 1 commit into from
Mar 21, 2025

Conversation

jessegrabowski
Copy link
Member

When a mean vector has exactly one element, scipy.stats.multivariate_normal.rvs squeezes the leading dimension, which was causing errors in fit_laplace for models with exactly one parameter.

This PR patches the behavior by adding a check for this corner case.

@jessegrabowski jessegrabowski added the bug Something isn't working label Mar 21, 2025
Copy link
Member

@fonnesbeck fonnesbeck left a comment

Choose a reason for hiding this comment

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

LGTM

@fonnesbeck fonnesbeck merged commit 7d62c53 into pymc-devs:main Mar 21, 2025
5 checks passed
@ricardoV94
Copy link
Member

Why not use the numpy one that doesn't have that stupid squeeze behavior?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants