-
-
Notifications
You must be signed in to change notification settings - Fork 268
HSGP: Birthdays Example #627
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
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
The simple model is ready for a first round of review. |
Nice @juanitorduz !! So this is an extension of your original blog post? I was gonna read when I got the time, but I might read and review this NB if that's the same and helpful to you |
Well, we decided with Bill that we will present a simpler model to illustrate HSGP and then Bill will add at the end the complete model from Aki. I was not able to add the Horseshoe prior (very bad r hats and divergences) in my post so Bill will give it a go :) All feedback is welcome! |
Ok, so it sounds like it's your post updated + simpler model, so I'll definitely review this PR instead! Please feel free to ping me when it's ready for review |
As discussed with Bill, we want to keep the model specification closer to the Stsan one for this example. In 08f4bc8 , I changed the Remark: Note this corresponds to |
@bwengals I added a small comment on the first basis vectors in 67ef3fc . Let me know what you think and how much you think we should expand (related to pymc-devs/pymc#7115) |
In view of #626 (comment) I think the very first iteration is ready for review in order to collect feedback. |
The pre-commit-ci jobs fails with a strange error. Still the pre-commit on the GitHub actions passes :) |
ok thanks! View entire conversation on ReviewNB |
@bwengals just a small ping 🤗 for a last review 😅 |
maybe missed it earlier, but I do think it'd be nice to say something like "Next we're going to systematically look at seasonality, first yearly, then monthly" ... etc. Just wanted to bring it up again in case it got lost in the shuffle -- also totally ok if you think it messes your flow View entire conversation on ReviewNB |
Wanna re-mention this one:
All of these building blocks should not come as a surprise after looking into the EDA section.
I think it's better, especially for beginners, to not say things are obvious or not a surprise, because it doesn't help understanding and only potentially makes them feel dumb. To be honest after doing the EDA above, I dunno if I'd make the exact same model (unless I was copying the Vehtari case study). View entire conversation on ReviewNB |
View / edit / reply to this conversation on ReviewNB bwengals commented on 2024-03-27T21:48:02Z the classic birthdays example dataset (see {cite:p} I think it'd be good to also cite Vehtari et al's GPTools matlab package. I think this is where birthdays makes it's first appearance, but would need to double check.
rather focus on the implementation and how to use PyMC's {class} and
As at the moment there is no HSGP wrapper in NumPyro, this example is a great resource to learn about the method internals. could consider removing the "at the moment there is no HSGP wrapper in Numpyro", just so you no one will need to update this later if they do add it someday juanitorduz commented on 2024-03-29T09:10:28Z Done! juanitorduz commented on 2024-03-29T09:11:02Z I also added a link to theis note about the source of the birthdays dataset https://statmodeling.stat.columbia.edu/2020/10/25/birthday-data/ |
View / edit / reply to this conversation on ReviewNB bwengals commented on 2024-03-27T21:48:03Z
Nvm, it comes up later |
View / edit / reply to this conversation on ReviewNB bwengals commented on 2024-03-27T21:48:04Z Is this a raw cell or a markdown cell? juanitorduz commented on 2024-03-29T08:29:38Z No, it is a box-cell, see the rendered docs https://pymcio--627.org.readthedocs.build/projects/examples/en/627/gaussian_processes/GP-Births.html ;) |
View / edit / reply to this conversation on ReviewNB bwengals commented on 2024-03-28T23:39:49Z this is nifty...
|
View / edit / reply to this conversation on ReviewNB bwengals commented on 2024-03-28T23:39:50Z Maybe a smaller markdown header size instead of a bullet for these? juanitorduz commented on 2024-03-29T08:51:21Z done! |
View / edit / reply to this conversation on ReviewNB bwengals commented on 2024-03-28T23:39:51Z I wonder if the conclusion could be expanded a bit? It feels a bit like trailing off here, especially since you've beefed up the intro (which was really nice!). Some takeaways I have are:
juanitorduz commented on 2024-03-29T09:08:33Z Added! Let me know what you think :) |
No, it is a box-cell, see the rendered docs https://pymcio--627.org.readthedocs.build/projects/examples/en/627/gaussian_processes/GP-Births.html ;) View entire conversation on ReviewNB |
You are 100% right! Let me rephrase it 🙏 View entire conversation on ReviewNB |
Let me know what you think about the change :) View entire conversation on ReviewNB |
done! View entire conversation on ReviewNB |
Added! Let me know what you think :) View entire conversation on ReviewNB |
Done! View entire conversation on ReviewNB |
I also added a link to theis note about the source of the birthdays dataset https://statmodeling.stat.columbia.edu/2020/10/25/birthday-data/ View entire conversation on ReviewNB |
thank you for your comments @bwengals ! I think I addressed them all. Let me know what you think about the changes :) https://pymcio--627.org.readthedocs.build/projects/examples/en/627/gaussian_processes/GP-Births.html is the current rendered version |
One last detail in the conclusion: The complexity for HSGP is While the pre-computation cost of the basis functions is O(m2n), the compu- tational cost of learning the covariance function parameters is O(mn + m) in every step of the optimizer or sampler. This is a big advantage in terms of speed for iterative algorithms such as Markov chain Monte Carlo (MCMC). Another advantage is the reduced memory requirements of automatic differentia- tion methods used in modern probabilistic programming frame- works, such as Stan (Carpenter et al., 2017) and others. This is because the memory requirements of automatic differentiation scale with the size of the autodiff expression tree which in direct implementations is simpler for basis function than covariance matrix-based approaches |
Shall I merge @juanitorduz ? |
Yes :) 🙏 |
Closes #626
Scope:
TODO:
📚 Documentation preview 📚: https://pymc-examples--627.org.readthedocs.build/en/627/