-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Fix error in docstring example for MatrixNormal #7599
base: main
Are you sure you want to change the base?
Conversation
] |
pymc/distributions/multivariate.py
Outdated
colchol_packed = pm.LKJCholeskyCov('colcholpacked', n=3, eta=2,compute_corr=False, | ||
sd_dist=sd_dist) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bit more succinct?
colchol_packed = pm.LKJCholeskyCov('colcholpacked', n=3, eta=2,compute_corr=False, | |
sd_dist=sd_dist) | |
colchol_packed, _, _ = pm.LKJCholeskyCov('colcholpacked', n=3, eta=2, sd_dist=sd_dist) |
colchol_packed = pm.LKJCholeskyCov('colcholpacked', n=3, eta=2, | ||
sd_dist=sd_dist) | ||
colchol_packed = pm.LKJCholeskyCov('colcholpacked', n=3, eta=2,compute_corr=False, | ||
sd_dist=sd_dist) | ||
colchol = pm.expand_packed_triangular(3, colchol_packed) | ||
# Setup left covariance matrix | ||
scale = pm.LogNormal('scale', mu=np.log(true_scale), sigma=0.5) | ||
rowcov = pt.diag([scale**(2*i) for i in range(m)]) | ||
vals = pm.MatrixNormal('vals', mu=mu, colchol=colchol, rowcov=rowcov, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The suggestion can't be applied directyl, but this seems more clean
vals = pm.MatrixNormal('vals', mu=mu, colchol=colchol, rowcov=rowcov, | |
vals = pm.MatrixNormal('vals', mu=mu, colchol=colchol, rowcov=rowcov, observed=data) |
@roesta07 you can ignore that pre-commit fail, it's indeed not related to your PR |
Co-authored-by: Ricardo Vieira <[email protected]>
…rrent version
Description
The compute_corr parameter in pm.LKJCholeskyCov is set to True by default, which causes the issue in latest pymc versions.
Also discussed here: https://discourse.pymc.io/t/matrixnormal-example-in-documentation-throws-an-error/16171
Related Issue
Checklist
Type of change
📚 Documentation preview 📚: https://pymc--7599.org.readthedocs.build/en/7599/