[unemployment_shocks] Rigorous LOO derivation + jax-only computation#941
Merged
Conversation
Rewrite the "Computational methods" section as a formal assumption/proposition/proof: state the conditional-independence assumption (noting it is false for the time series and revisited below), prove the exact Gelfand identity for the LOO predictive density, and obtain the harmonic-mean estimator as a Monte Carlo average that becomes exact a.s. as S -> infinity. Use explicit integral notation throughout and follow the blank-line-per-sentence convention. Keep the pointwise LOO computation entirely in jax (jax.scipy.special.logsumexp, jnp.log, jnp.sqrt) instead of bouncing between jax and numpy. Verified end-to-end on GPU: r_hat=1.00, 0 divergences, elpd diff 11.8 vs SE 5.7, p_loo 3.6/6.5, all Pareto k < 0.7. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
8 tasks
📖 Netlify Preview Ready!Preview URL: https://pr-941--sunny-cactus-210e3e.netlify.app Commit: 📚 Changed LecturesBuild Info
|
Trim the LOO exposition: drop the infinite-variance/importance-weights caveat and the Pareto-k/PSIS and AIC/BIC discussion (kept consistent, no dangling references). Remove the posterior-predictive asymmetry section, and adjust the plan and conclusion so the lecture no longer promises a check it no longer performs. Fix a few typos. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tightens the Comparing models with cross-validation → Computational methods section of
unemployment_shocks, in response to a review that the importance-sampling argument was too heuristic for an advanced-analysis audience.What changed
Prose. The derivation of the leave-one-out predictive density is rewritten as a formal assumption / proposition / proof (using
sphinx_proof):with explicit integral notation (no
E[·]) so the integrating density is visible at every step.Code. The pointwise LOO computation now stays entirely in jax (
jax.scipy.special.logsumexp,jnp.log,jnp.sqrt) instead of round-tripping through numpy/scipy.COVID remains excluded: at annual end-of-year frequency the episode is a single 6.7% point with a V-shaped (fast-up-fast-down) recovery, which cuts against the asymmetry thesis rather than illustrating it.
Testing
Ran end-to-end on GPU (
jupytext --to py):r_hat= 1.00, 0 divergencesp= 3.6 (linear), 6.5 (jump)az.compareAll numerical claims in the prose match the run.
🤖 Generated with Claude Code