site banner

Wellness Wednesday for March 22, 2023

The Wednesday Wellness threads are meant to encourage users to ask for and provide advice and motivation to improve their lives. It isn't intended as a 'containment thread' and any content which could go here could instead be posted in its own thread. You could post:

  • Requests for advice and / or encouragement. On basically any topic and for any scale of problem.

  • Updates to let us know how you are doing. This provides valuable feedback on past advice / encouragement and will hopefully make people feel a little more motivated to follow through. If you want to be reminded to post your update, see the post titled 'update reminders', below.

  • Advice. This can be in response to a request for advice or just something that you think could be generally useful for many people here.

  • Encouragement. Probably best directed at specific users, but if you feel like just encouraging people in general I don't think anyone is going to object. I don't think I really need to say this, but just to be clear; encouragement should have a generally positive tone and not shame people (if people feel that shame might be an effective tool for motivating people, please discuss this so we can form a group consensus on how to use it rather than just trying it).

5
Jump in the discussion.

No email address required.

I'd consider negative "area" to be a central case of integration, part of the basic definition, rather than an edge case ... but "edge" vs "central" is a matter of opinion.

I would say the worst edge case is functions without a priori bounds (whether on the function itself, on one of its derivatives, on variance...). Show me the most advanced deterministic adaptive quadrature algorithm your package has, and allow me to pick a truly arbitrary f(x) to give to it, and I can make the error (actual_integral - integrate(f(x),lb,ub)) arbitrarily large, even if actual_integral is 1. Use a stochastic algorithm and I can't guarantee "arbitrarily large" for the error, but I can still get "arbitrarily large in all but an arbitrarily small fraction of runs".

Your package docs will hopefully warn you about that, if you know what you're looking for. I just checked Matlab integral for an example, and a careful reader of "uses the absolute error tolerance to limit an estimate of the absolute error" in their docs will stop and say "wait, an estimate?" Looking at scipy, the quad doc says "An estimate of the absolute error", but the quad tutorial just says "an upper bound on the error", which they probably think is a fine description because it's almost always true in practice...

Sorry if this all sounds kind of nitpicky. I might be feeling pissy right now because I wrote an algorithm which is perfect in exact arithmetic and has been getting heavy use for months, becoming a core part of user workflows ... and now people are finding floating-point-arithmetic failure cases that I really should have anticipated.