A Primer on Bayesian Methods for Multilevel Modeling
bayesianmultilevel-modelinghierarchical-modelspymcmcmcstatistics
Abstraction: Bayesian hierarchical modeling with PyMC3 using partial pooling
Key points:
- Multilevel models allow parameters to vary by group; hierarchical models nest parameters within one another
- Complete pooling (single estimate) vs. no pooling (independent estimates) represent the bias-variance tradeoff extremes; partial pooling is the multilevel compromise
- Partial pooling estimate is approximately a weighted average of unpooled county estimates and pooled state estimate, weighted by sample size
- Demonstrates varying-intercept, varying-slope, and varying-intercept-plus-slope models on EPA radon dataset (80,000 houses, Minnesota)
- Floor coefficient estimate: approximately -0.66, meaning houses without basements have ~52% the radon levels of those with basements
- Cross-validation RMSE: unpooled=0.86, pooled=0.84, multilevel=0.79; uses PyMC3 with NUTS sampler
Connections: Pymc · Bayesian Inference · Multilevel Modeling · Markov Chain Monte Carlo · Hierarchical Models