PyMC3

This is an example of running PyMC3 inside this project’s docker container. This example is taken from Hierarchical Binominal Model: Rat Tumor Example. Please visit the site to see the complete example.

Example

Model

png

png

2.403
14.319

Computing the Posterior using PyMC3

Auto-assigning NUTS sampler...
Initializing NUTS using jitter+adapt_diag...
Sequential sampling (2 chains in 1 job)
NUTS: [theta, ab]
Sampling chain 0, 0 divergences: 100%|██████████| 3000/3000 [00:16<00:00, 183.25it/s]
Sampling chain 1, 0 divergences: 100%|██████████| 3000/3000 [00:13<00:00, 220.21it/s]
The number of effective samples is smaller than 25% for some parameters.
png

png

png

png

png

png

array([ 2.4517012 , 14.57163503])

Session Info

jupyter core     : 4.6.1
jupyter-notebook : 6.0.1
qtconsole        : not installed
ipython          : 7.10.2
ipykernel        : 5.1.3
jupyter client   : 5.3.3
jupyter lab      : 1.2.4
nbconvert        : 5.6.1
ipywidgets       : not installed
nbformat         : 4.4.0
traitlets        : 4.3.3
conda==4.8.0
conda-package-handling==1.6.0
pymc3==3.8