The code in this repository runs a Plotly Dash app that animates a series of Bayesian updates of beta distributions with binomial data
Application controls:
- Restart Animation - reset the animation to its first state, when only the starting prior beta distribution is displayed
- Play Animation - toggles the animation on or off; 'off' pauses the animation at its current state
- Animation Update Frequency (sec) - the animation updates once every X seconds, where X is chosen here
- Beta parameter alpha starting value (prior) - the starting value for the beta parameter alpha; accepts values with only up to 2 decimal places
- Beta parameter beta starting value (prior) - the starting value for the beta parameter beta; accepts values with only up to 2 decimal places
- Number of binomially distributed data points - how long the sequence of binomial data is, i.e., the number of updates
- Random seed - pseudo-random seed that allows reproducible results whenever the same seed is chosen
- Binomial Proportion (True Beta Distribution Mode) - the proportion used to generate the binomially distributed data
This webpage shows an example of how the beta-binomial model can be used. It also shows videos of beta distribution upates from the Plotly Dash applicaton.
Below is a sequence of images showing a series of beta-binomial updates.
From the top project directory, you can run these commands:
sudo docker build -t binomial-docker .
sudo docker run -p 8050:8050 binomial-docker
In the commands above, you may substitute a name of your own choosing for binomial-docker
.
Then point your web browser at:
From the 'src' directory, you can run these commands:
poetry install
poetry shell
python beta_binomial.py
Then point your web browser at: