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

ENH: add possibility to fix parameters in multivariate normal fit #18986

Merged
merged 12 commits into from Aug 28, 2023

Conversation

dschmitz89
Copy link
Contributor

What does this implement/fix?

This is a follow up from #18361: add the possibility to fix mean and covariance during fitting a multivariate normal to data. Such functionality is built in for univariate distributions. The math is pretty straight forward, the tricky parts are useful error messages.

@dschmitz89 dschmitz89 added the enhancement A new feature or improvement label Jul 30, 2023
@mdhaber mdhaber requested a review from tupui July 30, 2023 22:45
Copy link
Contributor

@mdhaber mdhaber left a comment

Choose a reason for hiding this comment

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

Could you point to the reference that the math is as simple as this when one shape is fixed?

scipy/stats/_multivariate.py Outdated Show resolved Hide resolved
scipy/stats/_multivariate.py Outdated Show resolved Hide resolved
scipy/stats/_multivariate.py Outdated Show resolved Hide resolved
@mdhaber
Copy link
Contributor

mdhaber commented Aug 17, 2023

@dschmitz89 I took another quick look but I wasn't sure that you were done addressing comments. Please ping me when you think this is ready for another look.

@dschmitz89
Copy link
Contributor Author

dschmitz89 commented Aug 25, 2023

Could you point to the reference that the math is as simple as this when one shape is fixed?

@mdhaber : this should be ready now.

About your question: You mean that the covariance matrix is fixed? That should be covered here. $\mu$ does not depend on $\Sigma$ but $\Sigma$ on $\mu$.

Copy link
Contributor

@mdhaber mdhaber left a comment

Choose a reason for hiding this comment

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

Very close. Just a few suggestions.

scipy/stats/_multivariate.py Show resolved Hide resolved
scipy/stats/_multivariate.py Outdated Show resolved Hide resolved
scipy/stats/_multivariate.py Outdated Show resolved Hide resolved
scipy/stats/tests/test_multivariate.py Outdated Show resolved Hide resolved
scipy/stats/tests/test_multivariate.py Outdated Show resolved Hide resolved
scipy/stats/tests/test_multivariate.py Outdated Show resolved Hide resolved
@mdhaber mdhaber merged commit d07d4db into scipy:main Aug 28, 2023
24 checks passed
@dschmitz89
Copy link
Contributor Author

Thanks @mdhaber , I was about to fix the last errors now but you already went ahead, much appreciated.

@mdhaber mdhaber added this to the 1.12.0 milestone Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A new feature or improvement scipy.stats
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants