[SciPy-Dev] speed of nosetests scipy.stats

josef.pktd at gmail.com josef.pktd at gmail.com
Wed Jan 12 19:21:48 EST 2011


On Wed, Jan 12, 2011 at 6:58 PM, Robert Kern <robert.kern at gmail.com> wrote:
> On Wed, Jan 12, 2011 at 17:47,  <josef.pktd at gmail.com> wrote:
>> On Wed, Jan 12, 2011 at 5:52 PM, Keith Goodman <kwgoodman at gmail.com> wrote:
>>> On Wed, Jan 12, 2011 at 2:42 PM,  <josef.pktd at gmail.com> wrote:
>>>
>>>> and what kind of operation produces
>>>> "Warning: invalid value encountered in subtract" ?
>>>>
>>>> I get hundreds of these
>>>
>>> http://mail.scipy.org/pipermail/numpy-discussion/2010-November/054128.html
>>
>> Yes, I will switch soon again to general ignore. But I might have a
>> look at some of the reasons for these warnings in scipy.stats.
>>
>> I know zero division error, but I have no idea what's an invalid value
>> for subtract.
>> I thought we can subtract anything from anything that might be a
>> number or "not a number" or infinite.
>
> It just means that a NaN popped up somewhere in the calculation when
> there was no NaN in the inputs, thus setting a floating point
> exception flag in your FPU, nothing more. Note that the message says
> "in subtract", not "for subtract". It's not a value judgment about
> your inputs.
>
> [~]
> |1> np.seterr(all='print')
> {'divide': 'ignore', 'invalid': 'ignore', 'over': 'ignore', 'under': 'ignore'}
>
> [~]
> |2> np.subtract(np.inf, np.inf)
> Warning: invalid value encountered in subtract
> nan

Thanks,

I only tried

>>> np.seterr()
{'over': 'print', 'divide': 'print', 'invalid': 'print', 'under': 'ignore'}

>>> np.inf - np.inf
-1.#IND

which is obviously something different from np.subtract

A lot of nans in the calculations is not good news. I just wonder if
some of it is because of the switch to logs in some calculations
(logpdf)

>>> 0**0
1
>>> 0*np.log(0)
Warning: invalid value encountered in double_scalars
nan

I'm getting several of these warnings also.

But since I had warnings turned off for so long, I don't know what the
historical benchmark for this is.

Josef

>
> [~]
> |3> np.subtract(np.nan, np.nan)
> nan
>
> --
> Robert Kern
>
> "I have come to believe that the whole world is an enigma, a harmless
> enigma that is made terrible by our own mad attempt to interpret it as
> though it had an underlying truth."
>   -- Umberto Eco
> _______________________________________________
> SciPy-Dev mailing list
> SciPy-Dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-dev
>



More information about the SciPy-Dev mailing list