[ar1_bayes] Removed PyMC dependency and style-sheet compliance#569
[ar1_bayes] Removed PyMC dependency and style-sheet compliance#569HumphreyYang wants to merge 12 commits into
Conversation
mmcky
left a comment
There was a problem hiding this comment.
Thanks @HumphreyYang -- just one minor comment re: citation. Should I organise @thomassargent30 to review?
There was a problem hiding this comment.
Pull Request Overview
This PR removes PyMC as a dependency from the AR(1) Bayesian analysis lecture, simplifying the codebase to use only NumPyro for Bayesian inference. The changes modernize variable naming conventions and clean up the implementation.
Key changes:
- Removed all PyMC imports, installations, and model implementations
- Updated variable naming to use Greek letters (ρ, σ) instead of Latin equivalents
- Fixed minor typos and improved code consistency
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Matt McKay <mmcky@users.noreply.github.com>
Thanks Matt, I think it's fine. This is a minor change : ) |
|
thanks @HumphreyYang are you happy for me to merge this? |
|
@mmcky Where do I find the latest deployment? I can see above "🚀 Deployed on https://68bb28185ee35015bb2cce79--nostalgic-wright-5fa355.netlify.app/" I'm guessing this is out of date because it's not compliant with the syle manual (e.g., sentences running together instead of being followed by line breaks). I find this PR a bit hard to jump into quickly because I'm unsure of the deployment and the title of the lecture is missing. |
Many thanks @jstac, please see the latest deployment of the lecture Posterior Distributions for AR(1) Parameters: We will include the lecture title and the latest deployment of the lecture next time we ping you for review. Many thanks in advance! (I pushed some more updates since I found some more paragraphs with multiple sentences) |
@HumphreyYang this sort of triggering doesn't work. I think it will only work when a PR is authored initially by |
|
Many thanks @mmcky, this PR should be compliant since I have run the same instruction on my end, but please let me know if your run spots anything new! |
|
thanks @HumphreyYang -- you're right. I'll open an issue to figure out how we can improve the |
Many thanks @mmcky! It's interesting that it posts deployment this time : ) |
|
@HumphreyYang it looks like |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
📖 Netlify Preview Ready! Preview URL: https://pr-569--sunny-cactus-210e3e.netlify.app (7e829d7) 📚 Changed Lecture Pages: ar1_bayes |
|
📖 Netlify Preview Ready! Preview URL: https://pr-569--sunny-cactus-210e3e.netlify.app (075b0bb) 📚 Changed Lecture Pages: ar1_bayes |
|
📖 Netlify Preview Ready! Preview URL: https://pr-569--sunny-cactus-210e3e.netlify.app (255d027) 📚 Changed Lecture Pages: ar1_bayes |
|
I find this code quite confusing: def AR1_model(data):
# Set prior
ρ = numpyro.sample('ρ', dist.Uniform(low=-1., high=1.))
σ = numpyro.sample('σ', dist.HalfNormal(scale=jnp.sqrt(10)))
# Expected value of y in the next period (ρ * y)
yhat = ρ * data[:-1]
# Likelihood of the actual realization
numpyro.sample('y_obs',
dist.Normal(loc=yhat, scale=σ), obs=data[1:])I think I've gotten used to JAX's functional style... Nothing is being returned here. How does it work? Maybe I'm the only one who finds this confusing. Or maybe we need some discussion around the code to explain how it works... |
Hi @jstac, I think that concern is totally fair. I was confused when I first saw this syntax. NumPyro uses a functional core with an imperative shell: the function here is just a specification (like writing specification down in When we call It can be a bit much for readers who just want posterior draws, so I can add a few simple notes next to the first NumPyro code cells in the previous lecture to demystify this a little. If that sounds good, I’ll open a separate issue and PR. |
|
Thanks @HumphreyYang , that would be great. I'm starting to really appreciate the explicitness and clean logic of JAX. |
|
🤖 Status note for a future session — from a maintainer investigation on 2026-07-08 into why open-PR previews 404. Context only, not instructions. Netlify preview: https://pr-569--sunny-cactus-210e3e.netlify.app/ currently returns 404. Why previews are down (repo-wide findings)1. This branch is stale — 181 commits behind 2. The arviz failure was a red herring — do NOT pin arviz or rewrite plotting. A 2026-07-07 rebuild also failed in ⭐ Directly relevant to this PRThis PR edits Recommended first step for this PRUpdate this branch to This PR touches: |
Key changes:
rho, sigmain NumPyro code