Skip to content

Instantly share code, notes, and snippets.

@terrycojones
Last active March 29, 2016 16:37
Show Gist options
  • Select an option

  • Save terrycojones/e446f7084e73c98cc35c to your computer and use it in GitHub Desktop.

Select an option

Save terrycojones/e446f7084e73c98cc35c to your computer and use it in GitHub Desktop.
from scipy.stats import dirichlet
>>> dirichlet.logpdf([0.4] + [(1.0 - 0.4) / 19] * 19, alpha=[0.05] * 20)
3.8604182571761925
>>> dirichlet.logpdf([0.6] + [(1.0 - 0.6) / 19] * 19, alpha=[0.05] * 20)
10.793871605825785
>>> dirichlet.logpdf([0.9] + [(1.0 - 0.9) / 19] * 19, alpha=[0.05] * 20)
35.431292971337086
>>> dirichlet.logpdf([0.95] + [(1.0 - 0.95) / 19] * 19, alpha=[0.05] * 20)
47.89123572023729
>>> dirichlet.logpdf([0.98] + [(1.0 - 0.98) / 19] * 19, alpha=[0.05] * 20)
64.400747372849281
>>> dirichlet.logpdf([0.05] * 20, alpha=[0.05] * 20)
-2.4586708235088039
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment