help-octave
[Top][All Lists]
Advanced

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

Re: consistent crash using gammrnd


From: John W. Eaton
Subject: Re: consistent crash using gammrnd
Date: Wed, 18 Jul 2007 12:31:33 -0500

On 16-Jul-2007, David Bateman wrote:

| Hermann wrote:
| > Am Samstag, 14. Juli 2007 schrieb Paul Kienzle:
| >
| >   
| >>> gamrnd(rand(100,1),rand(100,1))
| >>>       
| >> The attached patch fixes the gamrnd bug ... it was doing
| >> vector/vector rather than vector./vector.
| >>     
| >
| > Hi,
| > I$,1ry(Bm not sure, but maybe this should be .* instead of ./ ? I noted 
that 
| > in 'help randg' it sais
| >
| > | This can be used to generate many distributions:
| > |
| > | `gamma (a, b)' for `a > -1', `b > 0'
| > |            r = b * randg (a)
| >
| >   
| Well, yes and no.. The current definition of gampdf, gamcdf and gamrnd
| use a definition of 1/mu for the parameter B. So the current behavior of
| gamrnd is consistent with gamcdf, gampdf and gaminv. Unfortunately this
| seems to be the reverse of what is done in Matlab. For compatibility its
| probably better to mimic the matlab behavior. Consider the attached
| patch that changes the behavior to be consistent with matlab.. Note that
| exppdf, etc are also concerned are they are really just special cases of
| the gamma distributions.

Please check in this change.

| Do the other statistics functions have the same issues? I don't have the
| statistics toolbox for matlab and so can't easily check...

Could someone please check this and let us know whether other changes
are needed?

Thanks,

jwe


reply via email to

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