5
$\begingroup$

A simple question.

If $Y=\frac{1}{X}$ and I know $f_X(x)$, is it true that $E(Y) = E(1/X) = \int_{-\infty}^\infty \frac{1}{x}f_X(x) dx$?

$\endgroup$
6
$\begingroup$

Yes. In general if $X\sim f(x)$ then for a function $g(x)$ you have $E(g(X)) = \int g(x)f(x)dx$. You can verify this for simple cases by deriving the distribution of the transformed variable. The completely general result takes some more advanced math which you can probably safely avoid :)

$\endgroup$
  • $\begingroup$ Thanks. I realised this group is far more advanced than my level of stats, but I appreciate your simple answer! $\endgroup$ – Mitch May 16 '11 at 5:27
  • 1
    $\begingroup$ There could be trouble if X can be zero. $\endgroup$ – mark999 May 16 '11 at 9:01
  • $\begingroup$ @mark999 I don't think so; $f$ is continuous from his notation so $Pr(X=0)=0$. If the integral diverges then the expectation is still well defined, it's just infinite. Depends on what troubles you :) $\endgroup$ – JMS May 16 '11 at 23:54
  • $\begingroup$ I'm not sure I understand. What if $X$ was uniform on (-1,1)? $\endgroup$ – mark999 Jun 21 '11 at 7:52
  • $\begingroup$ @mark999 That's true; I guess I shot that comment off too quickly. In your example $E(1/X)$ doesn't exist since the integrals $\int_0^{1} 0.5/x\ dx$ and $\int_{-1}^{0} 0.5/x\ dx$ are $\pm \infty$ respectively. But neither does $E(Y)$ so the "equality" holds in some sense... $\endgroup$ – JMS Jun 22 '11 at 18:37
1
$\begingroup$

Another approach if you are happy with a numerical estimate (as opposed to the theorectical exact value) is to generate a bunch of data from the distribution, do the transformation, then take the mean of the transformed data as the estimate of the expected value. This avoids integration which can be nice in ugly cases, but does not give the theory, relationship, or exact value.

$\endgroup$

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.