Add variances dispatch for distributions#8084
Add variances dispatch for distributions#8084jessegrabowski wants to merge 5 commits intopymc-devs:mainfrom
Conversation
91b1d5c to
9649395
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8084 +/- ##
==========================================
- Coverage 90.80% 85.29% -5.52%
==========================================
Files 121 124 +3
Lines 19443 19773 +330
==========================================
- Hits 17656 16865 -791
- Misses 1787 2908 +1121
🚀 New features to boost your workflow:
|
lucianopaz
left a comment
There was a problem hiding this comment.
LGTM. My only suggestion is that we move the maybe_resize utility from means and variances to utils.py, but I'll approve anyway and you can move it or not.
|
I move the I also added variance for some missing distributions (CAR, Wishart, and KroneckerNormal). Wishart was missing from |
dfb3f78 to
8167044
Compare
lucianopaz
left a comment
There was a problem hiding this comment.
Thanks for the fixes and improvements. I'm a bit unsure whether the variances should return inf or raise an error for Cauchy, Flat et al. I'm a bit more in favor of raising an error, but someone else should tie break.
Description
This PR adds a
variancefunction that returns the (symbolic) variance of a distribution. I added it because I thought it would be nice to have for the AutoGuide stuff; we can use themeanandvarianceof priors to initialize the parameters.This is a 90%+ LLM PR. I went through and tried to clean things up. I mostly copied the patterns from
mean.py.Related Issue
Checklist
Type of change