Public bug reported:

Binary package hint: octave3.0

I'm running Ubuntu 8.10 with octave3.0-1:3.0.1-6ubuntu1 installed and it
appears that the exponential distribution functions exppdf expcdf, and
expinv give erroneous results. The definitions for these functions are:

exppdf: lambda*e^(-lambda*x)
expcdf: 1-e^(-lambda*x)
expinv: -ln(1-p)/lambda

so using lambda = 0.1, x = 0.1, and p = 0.5 one would expect the
following results:

exppdf = 0.0099005
expcdf = 0.0099502
expinv = 6.9315

however, that's not the results that I'm getting:

octave:74> exppdf(0.1, 0.1)
ans =  3.6788
octave:75> expcdf(0.1, 0.1)
ans =  0.63212
octave:76> expinv(0.5, 0.1)
ans =  0.069315

Interestingly enough, the obsoleted exponential_ functions give the
correct results:

octave:77> exponential_pdf(0.1, 0.1)
ans =  0.099005
octave:78> exponential_cdf(0.1, 0.1)
warning: exponential_cdf is obsolete and will be removed from a future version 
of Octave; please use expcdf instead
ans =  0.0099502
octave:79> exponential_inv(0.5, 0.1)
ans =  6.9315

** Affects: octave3.0 (Ubuntu)
     Importance: Undecided
         Status: New

-- 
Exponential distribution functions are broken
https://bugs.launchpad.net/bugs/294570
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to