In this repo I give a tutorial of fitting multilevel probabilistic models. I explain what problems they're useful for and give implementations with TensorFlow Probability.
Scope:
- What is multilevel modeling? (Aka "mixed effects" or "hierarchical" models)
- Why is it Bayesian? How is different from classical regression, and how does it work?
- What problems is this useful for? (Hint: most problems!)
- How does one implement it? Here I use TensorFlow Probability (aka
tfp
), a project related to but separate from TensorFlow with modules for probabilistic modeling (e.g. Hamiltonian Monte Carlo sampling, etc).
-
Install docker version 18.06 or later (or perhaps a little earlier)
-
Execute in a terminal:
$ cd this-repo
$ docker-compose up --force-recreate --build
- Go to http://localhost:11000.
- Add a basic example of a multilevel model. Use the radon dataset, and fit a model with probabilistic county-level intercepts.
- Add a working implementation.
- Improve analysis and discussion. Add metrics for evaluating model accuracy, and improve visualizations of parameters and errors.
- Add a classical regression for comparison. Analyze the results and motivate the probabilistic multilevel approach.
- Add an example of a multilevel model that uses group-level covariates. (Use county-level Uranium data to improve county-level intercepts in the radon example).
- Add example with multilevel slopes (not just intercepts)
- Documentation
- docker instructions
- Add references, other helpful tutorials