Path: blob/master/docs/notebooks/degrees-of-freedom.ipynb
419 views
Kernel: bayesian-analysis-recipes
Purpose
Just testing my intuition w.r.t. degrees of freedom in the students T distribution.
Cauchy: df = 1.
Normal: df = infinity (or at least some really high number)
This should be reflected when using PyMC3.
In [8]:
Out[8]:
The autoreload extension is already loaded. To reload it, use:
%reload_ext autoreload
In [9]:
In [10]:
Out[10]:
Auto-assigning NUTS sampler...
Initializing NUTS using jitter+adapt_diag...
Multiprocess sampling (4 chains in 4 jobs)
NUTS: [nu, sd, mu]
Sampling 4 chains, 0 divergences: 100%|██████████| 16000/16000 [00:20<00:00, 790.93draws/s]
In [12]:
Out[12]:
Many degrees of freedom for normal distribution. Makes sense.
In [13]:
Out[13]:
Auto-assigning NUTS sampler...
Initializing NUTS using jitter+adapt_diag...
Multiprocess sampling (4 chains in 4 jobs)
NUTS: [nu, sd, mu]
Sampling 4 chains, 0 divergences: 100%|██████████| 16000/16000 [00:22<00:00, 709.93draws/s]
In [15]:
Out[15]:
Basically 1 degree of freedom when inferring from Cauchy-distributed data. Yes 😃.