Normal-gamma distribution in Python

1.1k Views Asked by At

Is there an implementation of the Normal-Gamma distribution for Python? I have looked over the internet, including scipy, and could not find it.

1

There are 1 best solutions below

0
On

I am not aware of any package which implements it.
But since its building blocks are the Gamma Distribution and the Normal Distribution you may use them from SciPy.

For instance, in order to generate samples you may do (From Wikipedia - Normal Gamma Distribution):

  • Sample τ (\tau) from a gamma distribution with parameters α (\alpha) and β (\beta).
  • Sample x from a normal distribution with mean μ (\mu) and variance 1 / λ τ (1 / (\lambda \tau)).