20
$\begingroup$

Around is a useful feature of Mathematica 12 to work with uncertain data.

x = Around[-1, {0.5, 1.5}]

$-1.0^{+1.5}_{-0.5}$

I'm curious how to get an absolute value of such uncertain data. When I use Abs directly I get an unexpected result:

Abs[x]

$1.0^{+1.5}_{-0.5}$

I have expected: $1.0^{+0.5}_{-1.0}$, because

Abs[x["Interval"]]

Interval[{0, 1.5}]

In total there are two issues:

  1. Upper and lower uncertainties are not interchanged when taking Abs.

  2. Crossing of zero is ignored.

Is this intended behaviour of Around or some sort of a bug?

How should I calculate absolute values of uncertain data points? For example, when I want to plot Abs of uncertain of data?

Update

Simple multiplication by a negative number gives incorrect result:

(-1)*x

$1.0^{+1.5}_{-0.5}$ (* Correct answer is $1.0^{+0.5}_{-1.5}$*)

$\endgroup$
  • 7
    $\begingroup$ That some for support. Around is pretty new and apparently very buggy. Or the two uf us haven't understood the deeper meaning of Around, yet. $\endgroup$ – Henrik Schumacher Aug 9 at 23:13
  • 2
    $\begingroup$ I guess @HenrikSchumacher's comment should begin That's one for support. ? $\endgroup$ – High Performance Mark Aug 10 at 16:33
  • 1
    $\begingroup$ I wouldn't call this "buggy", it just looks like Abs doesn't support Around in its initial implementation (unless it is documented to do so). But if you'd like it to, then yes, reach out to support and ask for it. $\endgroup$ – user6014 Aug 12 at 15:14
  • $\begingroup$ @user6014 There are better ways to implement unimplemented functions, for example, keep the original symbolic form. Since it evaluates to incorrect result without warnings I would call it a bug. BTW multiplication of Around by a number is documented but still produces incorrect result. $\endgroup$ – Shadowray Aug 13 at 1:16
  • $\begingroup$ -Around[-1, {0.5, 1.5}] has similar problems. The behavior of About seems consistent with f[About[x, {a,b}]] being About[f[x], {Abs[f'[x]]*a, Abs[f'[x]]*b}]. $\endgroup$ – Michael E2 Aug 13 at 1:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.