binomial function change [message #32248] |
Mon, 23 September 2002 21:15 |
air_jlin
Messages: 22 Registered: July 2001
|
Junior Member |
|
|
hi all,
maybe this was documented in the "what's new" back when idl 5.4
shipped, but since i couldn't find the change mentioned in places i
have access to (archives of this group, rsi tech tips, etc.), when i
was trying to debug a program i was writing in idl 5.3 that used
binomial(), i thought i'd mention it here to save anyone else from
wondering "what's going on?".
in idl 5.5, the following call returns the following result:
IDL> print,binomial(4,30,0.05)
% Compiled module: BINOMIAL.
0.0607712
% Program caused arithmetic error: Floating underflow
this result is correct.
in idl 5.3, this is what you get:
IDL> print,binomial(4,30,0.05)
% Compiled module: BINOMIAL.
% Compiled module: GAUSS_PDF.
0.0181180
the difference appears to be that for values of n>25, the 5.3 routine
defaults to calculating the cumulative binomial distribution using a
gaussian approximation.
best,
-Johnny
-------------------------------------------
Johnny Lin
CIRES, University of Colorado
Work Phone: (303) 735-1636
Web: http://cires.colorado.edu/~johnny/
-------------------------------------------
|
|
|