help-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-gsl] question about dirichlet lnpdf function (potential bug)


From: per freem
Subject: [Help-gsl] question about dirichlet lnpdf function (potential bug)
Date: Sun, 12 Jul 2009 13:09:37 -0400

 hi all,

i have been using the function for the pdf of the dirichlet distribution in
GSL (through a python interface.)

the function works correctly on most values, but appears to return nan when
it shouldn't on more extreme cases. for example, the pdf evaluated on the
set of values [0, 0, 1] with parameter settings [1/3, 1/3, 1/3] returns NaN,
even though [0, 0, 1] is a perfectly fine value for the dirichlet pdf that
should have non-zero probability. this is true for both the dirichlet_pdf
and dirichlet_lnpdf (log of pdf) functions.

in python notation, this is:

dirichlet_pdf([0, 0, 1], [1/3., 1/3., 1/3.])  (evaluates to NaN)
dirichlet_lnpdf([0, 0, 1], [1/3., 1/3., 1/3.])  (evaluates to NaN as well)

any idea why this is or how i can fix it?

thank you.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]