exppdf, expcdf, expinv

John W. Eaton jwe at octave.org
Thu Jan 15 11:44:03 CST 2009


On 15-Jan-2009, Thomas L. Scofield wrote:

| 
| It's been a while since I got the latest sources for Octave.  It  
| would probably have been in August, or perhaps Sept.---it was called  
| version 3.1.51+ then.  Anyway, I've checked the bug reports since  
| then and can find no record of a similar report.  The issue is the  
| role of lambda for the exponential distribution commands.  The  
| correct pdf for this distribution would have formula
| 
|     f(x) = lambda * exp(-lambda * x),    for  x >= 0
| 
| yielding a mean of lambda^(-1).  It seems as if these functions have  
| been implemented with lambda reciprocated, as in
| 
|     f(x) = exp(-x / lambda) / lambda,    for  x >= 0
| 
| If I run R and plot the exponential distribution with lambda =  
| 1/36.85, I get a plot which can only be duplicated in Octave if I  
| plot exppdf() with lambda = 36.85.  The expinv() and expcdf()  
| commands are consistent with exppdf(), both opposite to R.

Although different from R, the definition used by Octave appears to be
compatible with the one used in the exppdf function in Matlab's
statistics toolbox.  Although it is unfortunate that they are
different, I think most Octave users would agree that compatibility
with Matlab's interface is more important than being consistent with
R.

jwe


More information about the Bug-octave mailing list