1
$\begingroup$

I understand the computation of the uncertainty of independent Around values to be based on the following first order approximation $$ \delta f(x,y)=\sqrt{\left(\frac{\text{$\delta $f}}{\partial x}\text{$\delta $x}\right)^2+\left(\frac{\text{$\delta $f}}{\partial y}\text{$\delta $y}\right)^2}. $$

Thus I compute the uncertainty for the mean of around numbers to be $$ \delta\text{Mean}\left[\left\{\text{Around}\left[x_1,\text{$\delta $x}_1\right],\text{...}\text{Around}\left[x_{\text{n1}},\text{$\delta $x}_n\right]\right\}\right]=\frac{\sqrt{\text{$\delta $x}_1^2+\text{...}+\text{$\delta $x}_n^2}}{n} $$

and this seems to work when the uncertainties are different. For instance Mean[{Around[1,0.5],Around[1,0.25}] = Around[1,0.28]. However, when the uncertainties are equal, Mathematica returns an Around value with uncertainty unchange. For instance I would expect Mean[{Around[1,0.5],Around[1,0.5}] to return Around[1,0.35] but instead it returns Around[1,0.5]. And if the values are different, I do get the expected result, thus the Mean[{Around[2,0.5],Around[1,0.5]}]=Around[1.5,0.35].

So I'm assuming Mathematica is treating Mean[{Around[1,0.5],Around[1,0.5]}] as two correlated inputs, but why and how would you control this?

$\endgroup$
  • $\begingroup$ Looks like a bug to me - there is AroundReplace for the case of correlated quantities, so this should work as it is. My guess is that something inside Mean is simplifying the expression for the mean to (2*Around[1,0.5])/2 before doing any special handling of the Around quantities, which is causing the issue. The easiest fix for now is probably to use your own function to compute the mean, e.g. Total[#]/Length[#] &[{Around[1, 0.5], Around[1, 0.5]}] $\endgroup$ – Lukas Lang Oct 13 at 12:04
  • $\begingroup$ Please make a report to support@wofram.com $\endgroup$ – Daniel Huber Oct 13 at 12:08
  • $\begingroup$ I agree. There is probably a simplification happening which changes the calculation. I'll submit the note to support@wolfram.com. Thanks for confirming. $\endgroup$ – Kenric Oct 13 at 21:31

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.