Investigate variational inference for HBR - #520
Open
contsili wants to merge 5 commits into
Open
Conversation
Collaborator
Author
|
Also because pathfinder and advi underestimate the posterior widths, I would not perform model transfer when the reference model is estimated with them |
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.
Variational inference (VI) should make HBR faster as it replaces MCMC sampling with optimization. From a quick search I see that ADVI and Pathfinder might be the best VI algorithms for HBR from PyMC to choose from.
What is reported online is that ADVI might underestimate posterior uncertainty, particularly for the hierarchical variance parameters that control between-site variability (e.g.
intercept_sigma)Important
pathfinder needs
pymc-extraspackage. To allowpymc-extras >= 0.11.0we should implement first this issue #450.To reproduce
To see the results from the benchmark, see
04_HBR_SHASH_variational_inference_benchmark.ipynb(make sure to installpymc-extras == 0.10.0to run it)Findings from the notebook run
Regarding the posterior parameters:
intercept_sigma,mu_intercept_mu.slope_mu.epsilonanddeltaConclusions
TODO
question
is this convincing to go for pathfinder? The only problem is see is the high pareto k (=full posterior is poorly approximated) and the divergences from the MCMC in the edges (young and old ages). Other than that the centiles and zscores look good enough to me.