- Notifications
You must be signed in to change notification settings - Fork301
WIP ZeroSumNormal example notebook#210
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered byReviewNB |
review-notebook-appbot commentedAug 18, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
View / edit / reply tothis conversation on ReviewNB mjhajharia commented on 2021-08-18T00:14:14Z this is great!! I also really like the lucid writing style in the notebook :)) drbenvincent commented on 2021-08-18T13:51:51Z Thanks |
review-notebook-appbot commentedAug 18, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
View / edit / reply tothis conversation on ReviewNB mjhajharia commented on 2021-08-18T00:14:15Z
drbenvincent commented on 2021-08-19T08:32:26Z Have changed to the latest |
review-notebook-appbot commentedAug 18, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
View / edit / reply tothis conversation on ReviewNB twiecki commented on 2021-08-18T10:38:05Z deflectsions typo drbenvincent commented on 2021-08-19T08:28:55Z fixed |
review-notebook-appbot commentedAug 18, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
View / edit / reply tothis conversation on ReviewNB twiecki commented on 2021-08-18T10:38:06Z god -> good |
review-notebook-appbot commentedAug 18, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
View / edit / reply tothis conversation on ReviewNB twiecki commented on 2021-08-18T10:38:06Z Why does this look so terrible? drbenvincent commented on 2021-08-18T10:48:04Z We're at the limits of floating point precision? I'm not sure this plot is strictly required. I could switch it out for an drbenvincent commented on 2021-08-19T08:30:55Z Have removed this and replaced with OriolAbril commented on 2021-08-23T12:24:57Z I think np.allclose can take dataarrays directly and that it doesn't care if the input is 1d or multidimensional so I believe drbenvincent commented on 2021-09-05T10:55:42Z Yes - have switched to that. It will appear in an upcoming commit. |
review-notebook-appbot commentedAug 18, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
View / edit / reply tothis conversation on ReviewNB twiecki commented on 2021-08-18T10:38:07Z I'm curious what this does different than the manual approach above that leads to better convergence? drbenvincent commented on 2021-08-19T08:31:40Z Might have to refer to Adrian for an answer. Have added this question to a list of points to address in updates |
drbenvincent commentedAug 18, 2021
We're at the limits of floating point precision? I'm not sure this plot is strictly required. I could switch it out for an View entire conversation on ReviewNB |
drbenvincent commentedAug 18, 2021
Thanks View entire conversation on ReviewNB |
drbenvincent commentedAug 18, 2021
Thanks for the feedback so far 🙏🏻 Have addressed typos, switched to using the latest No more small scale comments needed for the moment - am working on some major updates after a discussion with@aseyboldt. Will shout when done 🙂 |
review-notebook-appbot commentedAug 18, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
View / edit / reply tothis conversation on ReviewNB chiral-carbon commented on 2021-08-18T19:43:09Z here would it be possible to use with pm.Model(coords={'obs_id': np.arange(3)}) as naive_model:and β = pm.Normal("β", 0, 10, dims='obs_id')it's not a major change but the best practice would be to use drbenvincent commented on 2021-08-19T08:29:33Z Good point. Did it in the first model, but then lapsed from best practice. Now fixed. |
review-notebook-appbot commentedAug 18, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
View / edit / reply tothis conversation on ReviewNB chiral-carbon commented on 2021-08-18T19:43:10Z same comment about using drbenvincent commented on 2021-08-19T08:30:03Z done |
drbenvincent commentedAug 19, 2021
fixed View entire conversation on ReviewNB |
drbenvincent commentedAug 19, 2021
Good point. Did it in the first model, but then lapsed from best practice. Now fixed. View entire conversation on ReviewNB |
drbenvincent commentedAug 19, 2021
done View entire conversation on ReviewNB |
drbenvincent commentedAug 19, 2021
Have removed this and replaced with View entire conversation on ReviewNB |
drbenvincent commentedAug 19, 2021
Might have to refer to Adrian for an answer. Have added this question to a list of points to address in updates View entire conversation on ReviewNB |
drbenvincent commentedAug 19, 2021
Have changed to the latest View entire conversation on ReviewNB |
OriolAbril commentedAug 23, 2021
I think np.allclose can take dataarrays directly and that it doesn't care if the input is 1d or multidimensional so I believe View entire conversation on ReviewNB |
review-notebook-appbot commentedAug 23, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
View / edit / reply tothis conversation on ReviewNB OriolAbril commented on 2021-08-23T12:25:05Z I find the notation a bit confusing. We are using drbenvincent commented on 2021-09-12T15:14:11Z Things are a bit different now with the new introduction. For that, I've kept the beta notation because it seems to work. For the intercept + deflections model, I've switched to |
review-notebook-appbot commentedAug 23, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
View / edit / reply tothis conversation on ReviewNB OriolAbril commented on 2021-08-23T12:25:06Z All variables are named drbenvincent commented on 2021-09-12T15:14:34Z This is labelling properly now. |
review-notebook-appbot commentedAug 23, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
View / edit / reply tothis conversation on ReviewNB OriolAbril commented on 2021-08-23T12:25:07Z I love this plot! Very minor nit is I would label the arrow corresponding to the intercept. drbenvincent commented on 2021-09-12T15:14:48Z Done |
review-notebook-appbot commentedAug 23, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
View / edit / reply tothis conversation on ReviewNB OriolAbril commented on 2021-08-23T12:25:07Z I have mixed feelings about the bullet points which extend a bit to the pair and posterior plots. First and foremost, the model is a complete failure because it doesn't converge (and because it won't ever converge). I don't see correlations by themselves as a failure too though, but as the main reason for this lack of convergence. And given the model is not converging, we can't trust its results, so it is expected for parameter recovery to fail, but it might not always be the case. We could have a model with no mixing and therefore no convergence but that by chance or because the initial points turned out to be close to the true parameters, it gets stuck there or very close and does "recover" the true parameters. Both models are as much a failure though even if this second hypothetical one "recovers" the parameters. I think the main factor in deciding how to address this is defining the target audience for this notebook. Do we already expect readers to know about MCMC sampling and convergence? drbenvincent commented on 2021-09-12T15:15:58Z I've change the wording around this model now. I think it makes more sense now in the context of the new introduction. |
review-notebook-appbot commentedAug 23, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
View / edit / reply tothis conversation on ReviewNB OriolAbril commented on 2021-08-23T12:25:08Z Line #9. β = pm.Deterministic("β", _β - m)I would be explicit and set I also don't have any suggestion so this feels a bit empty, but it would be great to try and find some more descriptive names for the drbenvincent commented on 2021-09-12T15:24:41Z added the I've used the |
drbenvincent commentedSep 5, 2021
Yes - have switched to that. It will appear in an upcoming commit. View entire conversation on ReviewNB |
drbenvincent commentedSep 12, 2021
Things are a bit different now with the new introduction. For that, I've kept the beta notation because it seems to work. For the intercept + deflections model, I've switched to View entire conversation on ReviewNB |
drbenvincent commentedSep 12, 2021
This is labelling properly now. View entire conversation on ReviewNB |
drbenvincent commentedSep 12, 2021
Done View entire conversation on ReviewNB |
drbenvincent commentedSep 12, 2021
I've change the wording around this model now. I think it makes more sense now in the context of the new introduction. View entire conversation on ReviewNB |
drbenvincent commentedSep 12, 2022
@tomicapretto Do you think we should revisit this oncepymc-devs/pymc#6121 is closed? |
tomicapretto commentedSep 12, 2022
Yes! |
drbenvincent commentedOct 9, 2022
Seeing aspymc-devs/pymc#6121 is now merged, let's pick this up. I'll rebase this and update the notebook to conform to the current style. |
fonnesbeck commentedDec 16, 2024
Dead or alive? |

Uh oh!
There was an error while loading.Please reload this page.
Here is the first draft of a notebook which showcases a new PyMC distribution,
ZeroSumNormalcreated by@aseyboldt.A few things to note:
this runs under v4 and it importsZeroSumNormalfrom a moduleZeroSumNormal.py. The idea is that after this pull requestAdded ZeroSumNormal Distribution pymc#4776 is done we can get rid of this import and just callpm. ZeroSumNormal.ZeroSumNormalfrom a moduleZeroSumNormal.py. The idea is that after this pull requestAdded ZeroSumNormal Distribution pymc#4776 is done we can get rid of this import and just callpm. ZeroSumNormal.To be clear, I'm not anticipating this pull request to be merged untilpymc-devs/pymc#4776 is done and the notebook can call
pm.ZeroSumNormalnatively.Open to comments and feedback.
TODO
ZeroSumNormaldoing better than the manual sum to zero constraint?