6
$\begingroup$

Bug introduced in 8.0 or earlier and persisting through 11.0.1


I've noticed this strange behavior and I'm wondering if it's a bug.

I define a Cauchy distribution:

c = CauchyDistribution[0, 1];

If I evaluate Mean[c], I get Indeterminate, as expected.

If I evaluate Expectation[x, x \[Distributed] c], I get Expectation[x, x \[Distributed] CauchyDistribution[0, 1]]. I would have expected Indeterminate, too, but that's ok.

However, if I evaluate Expectation[x + y, {x \[Distributed] c, y \[Distributed] c}], I get 0.

The sum of two independent Cauchy distributed random variables should be another Cauchy distributed random variable, right? Why is the expectation 0?

$\endgroup$
  • $\begingroup$ Another example of why I think it is best to avoid using prepackaged written up results , and go for general symbolic methods. Indeed, if you ask Mma to find the general solution, it works perfectly. Here: f = (1/(Pi (1 + x^2))) (1/(Pi (1 + y^2))); and Integrate[(x + y)*f, {x, -Infinity, Infinity}, {y, -Infinity, Infinity}] returns the appropriate 'does not converge' message. $\endgroup$ – wolfies Dec 10 '16 at 6:19
6
$\begingroup$

You can check that :

TransformedDistribution[ x + y, {x \[Distributed] CauchyDistribution[0, 1], 
                                y \[Distributed] CauchyDistribution[0, 1]}]

(* CauchyDistribution[0, 2] *)  

Expectation[z, z \[Distributed] CauchyDistribution[0, 2]]
(* Expectation[z, z \[Distributed] CauchyDistribution[0, 2]] *)

Mean[TransformedDistribution[ x + y, {x \[Distributed] c, y \[Distributed] c}]]
(* Indeterminate *)
$\endgroup$
  • 1
    $\begingroup$ So, the conclusion is it's a bug? $\endgroup$ – Sjoerd C. de Vries Jan 11 '13 at 12:19
  • $\begingroup$ @SjoerdC.deVries Yes it looks like it. $\endgroup$ – b.gatessucks Jan 11 '13 at 12:42
  • $\begingroup$ @AndyRoss can you confirm this diagnosis? $\endgroup$ – rcollyer Jan 11 '13 at 15:48
  • $\begingroup$ @rcollyer I was hoping for news from him too. $\endgroup$ – b.gatessucks Jan 11 '13 at 16:31

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.