# Latest content was relocated to https://bintanvictor.wordpress.com. This old blog will be shutdown soon.

## Sunday, November 2, 2014

### conditional probability - change of variable

Q: Suppose we already know f_X(x) of rvar X. Now we get an X-derived rvar Y:=y(X), where y() is a "nice" function of X. What's the (unconditional) distribution of Y?

We first find the inverse function of the "nice" function. Call it X=g(Y). Then at any specific value like Y=10, the unconditional density of Y is given by

f_Y(10)  = f_X(  g(10)  ) *  g'(10)

, where g'(10) is the curve gradient dx/dy evaluated at the curve point y=10.

Here's a more intuitive interpretation. [[applied stat and prob for engineers]] P161 explains that a density value of 0.31 at x=55 means the "density of probability mass" is 0.31 in a narrow region around x=55. For eg,
for a 0.22-narrow strip, Pr( 54.89 < X < 55.11) ~= 0.31 * 0.22 = 6.2%.
for a 0.1-narrow strip, Pr( 54.95 < X < 55.05) ~= 0.31 * 0.1 = 3.1%.
(Note we used X not x because the rvar is X.)

So what's the density of Y around y=10. Well, y=10 maps to x=55, so we know there's a 3.1% of Y falling into some neighborhood around 10, but Y's density is not 3.1% but   "3.1%/width of the neighborhood".   If that neighborhood has width = 0.1 for X, but smaller when "projected" onto Y.

The same neighborhood represents an output range. It has a 3.1% total probability mass. 54.95 < X < 55.05, or 9.99 < Y < 10.01, since Y and X has one-to-one mapping.

We use dx/dy at Y=10  to work out the width in Y projected by X's width. For 54.95 < X < 55.05, we get 9.99 < Y < 10.01, so the Y width is 0.02.

Pr( 54.95 < X < 55.05) ~= Pr( 9.99 < Y < 10.01)  ~= 3.1%