I tried to work with the inverse exponential distribution and encountered the following, which I think is an inconsistency in Mathematica (version 10.0.2):

dist = ExponentialDistribution[l];
distInv = TransformedDistribution[1/x, x\[Distributed]dist];

pdfInv[y_] = PDF[distInv, y] ;
pdfInv[y] // InputForm
(*Out: Piecewise[{{l/(E^(l/y)*y^2), y > 0}}, 0] *)

(*Out: -l (EulerGamma + Log[l]) *)

int = Assuming[yMax > 0 && l > 0, Integrate[y pdfInv[y], {y, 0, yMax}]]
(* l Gamma[0, l / yMax] *)

Limit[int, yMax->\[Infinity]]
(* l \[Infinity] *)

Basically, Mathematica claims that the mean of the inverse exponential distribution can be calculated and it gives an explicit expression for it (see above). However, I then tried to solve the integral of the expectation value explicitly and I think I showed that it diverges. Is there any flaw in my argumentation or is this a problem with Mathematica?

  • $\begingroup$ What version are you using? In 10.1.0 I get Mean@distInv evaluates to Infinity. $\endgroup$ – Stefan R May 8 '15 at 19:16
  • $\begingroup$ David, @StefanR I am on v.10.1.0 as well, and Mean@distInv returns Infinity for me as well. I have also noticed that you may be missing a : in your definition of pdfInv. $\endgroup$ – MarcoB May 8 '15 at 19:41
  • $\begingroup$ I'm on v. 10.0.2, which might be the cause of the problem. I try to update and will report later. $\endgroup$ – David Zwicker May 8 '15 at 20:05

It turns out this was a bug with version 10.0.2 of Mathematica. Upgrading to 10.1.0 resolved the issue and Mean@distInv now returns infinity.

  • $\begingroup$ Glad to hear that it was sorted out already. $\endgroup$ – MarcoB May 8 '15 at 20:54
  • $\begingroup$ Yeah, thanks to you guys. I'm always surprised by the confidence with which Mathematica spits out results, which turn out to be wrong :) $\endgroup$ – David Zwicker May 8 '15 at 21:02
  • 1
    $\begingroup$ It's scary actually... Since MMA results are correct "most of the time", it's easy to be lulled into complacency. I try to force myself to build in some verification tests into my calculations, much as you did in this case, but it's a lot of extra work! Nonetheless, I would be so much worse off without MMA that I can't even begin to complain... $\endgroup$ – MarcoB May 8 '15 at 21:30
  • $\begingroup$ I completely agree and I was joking... Although it would be funny to have Mathematica hesitate to display a result when it is not completely sure :) $\endgroup$ – David Zwicker May 8 '15 at 21:33
  • 2
    $\begingroup$ @DavidZwicker: That is covered in the Experimental`Umm,Maybe context... $\endgroup$ – ciao May 8 '15 at 22:17

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.