[SciPy-user] FloatingPointError: underflow encountered in stdtr

wierob wierob83@googlemail....
Sun Jun 7 04:45:37 CDT 2009


Hi,

I'm trying to perform a linear regression analysis using 
scipy.stats.linregress. I get an underflow during the calculation of the 
p-value.

File "C:\Python26\lib\site-packages\scipy\stats\distributions.py", line 2829,in _cdf
    return special.stdtr(df, x)
FloatingPointError: underflow encountered in stdtr

It seems that the error occurs in scipy.special.stdtr(df, x) if df = 
array([13412]) and x = array([61.88071696]).

>>> from scipy import special
>>> import numpy
>>> df = numpy.array([13412])
>>> x = numpy,array([61.88071696])
>>> special.stdtr(df,x)
array([ 1.])
>>> numpy.seterr(all="raise")
>>> special.stdtr(df,x)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
FloatingPointError: underflow encountered in stdtr

So, is there another function or datatype that can handle this?

kind regards
robert


More information about the SciPy-user mailing list