Repository navigation
docs(notebooks): stochastic volatility port - #49
Merged
Merged
Conversation
…red NUTS, checked by a particle filter
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.
PyMC's stochastic volatility model on the last 300 days of its S&P 500 data (MIT, vendored as notebooks/data/sp500.csv). The path is written non-centred (z_t ~ N(0,1), v_t = v_(t−1) + step·z_t): the centred version funnelled NUTS (step R-hat 1.11, ESS 28); non-centred gives R-hat ≈ 1.01, ESS ≈ 440 for the step. Hand-written gradient (incl. digamma for ν), checked against finite differences. Cross-check: on the last day smoothing = filtering, and a particle filter (1000 particles, same model with sites, parameters at their posterior means) agrees with NUTS (0.00261 ± 0.00108 vs 0.00259 ± 0.00111). Adds ~3.5 min to the render.