Hi all,

Eike Rathke wrote:
Hi Regina,

On Tuesday, 2008-04-01 18:55:35 +0200, Regina Henschel wrote:

[... Calc and Excel ...]
GAMMADIST(x;a;b;0) = 1 / (b**a * ?(a) ) * x**(a-1) * e**(-x/b)

vs.

[... ODFF ...]
GAMMADIST(x;?;?;FALSE()) = ?**? / ?(?) * x**(?-1) * e**(-?*x)

I think, that it is no good idea to change the meaning of a function. All old documents would break. I know there is ?=1/b and both definitions are usual in literature, but Calc should stick to one way.

I think that was an oversight and the formula present in ODFF derived
from literature. It should reflect the common implementation instead if
that yields acceptable results. I'll notfiy the OASIS subcommittee and
change the spec if no one objects. Thanks for letting us know.

Both formulas are actually identical. One uses a scale-parameter, the other the rate-parameter.

Both should yield also the same result.

I tested the function in R:

> dgamma(2,3,scale=5)
[1] 0.01072512

So, this is the correct result, if 5 is the scale. Tested with: R version 2.6.2 (2008-02-08)

Here GAMMADIST(2;3;5;FALSE) would return ?0.01134998

Now, this is wrong, IF 5 is the scale (but correct IF 5 is the rate).
> dgamma(2,3,rate=5)
[1] 0.01134998

Now, I like very much how R handles these functions. You can specify what a parameter is to avoid such errors.

If having to choose between one of the 2 parameters:
http://mathworld.wolfram.com/GammaDistribution.html
http://www.itl.nist.gov/div898/handbook/eda/section3/eda366b.htm
both Mathematica (Mathworld) and the NIST seem to favour the scale-parameter, but, as I am not very accustomed to practical use-cases, I don't have a strong opinion.

Sincerely,

Leonard


@Eike: You see, I'm still working on the subject „special functions in Calc“

I'm very pleased to see that, thank you :-)

  Eike



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to