The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Inactive » comp.soft-sys.math.mathematica

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Possible bug in InverseGammaRegularized?
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  

Posts: 66
Registered: 4/28/07
Possible bug in InverseGammaRegularized?
Posted: Feb 26, 2013 1:09 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

The following code gives the \delta \chi^2 for the confidence intervals as a function of the number of parameters n and desired number of sigmas m:
\delta \chi^2=2 InverseGammaRegularized[n/2, 1 - Erf[m/Sqrt[2]]]

The RHS can also be written as 2InverseGammaRegularized[n/2,0, Erf[m/Sqrt[2]]]
(notice the 0 in the arguments)

For example, for 5 params, 1 sigma and 5 digit precision:
In[1]:= n = 5; m = 1;
N[2 InverseGammaRegularized[n/2, 1 - Erf[m/Sqrt[2]]], 5]
N[2 InverseGammaRegularized[n/2, 0, Erf[m/Sqrt[2]]], 5]

Out[2]= 5.8876
Out[3]= 5.8876

but when I ask for only 3 digit precision, Mathematica 9 gives the following torrent of errors in the second case:

N[2 InverseGammaRegularized[n/2, 1 - Erf[m/Sqrt[2]]], 3]
N[2 InverseGammaRegularized[n/2, 0, Erf[m/Sqrt[2]]], 3]

Out[4]= 5.8876
During evaluation of In[4]:= $RecursionLimit::reclim: Recursion depth of 1024 exceeded. >>
... (more errors)
During evaluation of In[4]:= General::stop: Further output of $RecursionLimit::reclim will be suppressed during this calculation. >>

Is this a bug or am I missing something?


Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.