• Support PF! Buy your school textbooks, materials and every day products Here!

Probability density of a new variable

  • Thread starter fluidistic
  • Start date
  • #1
fluidistic
Gold Member
3,662
104

Homework Statement


Let X be a continuous random variable with parameters [itex]\langle x \rangle[/itex] and [itex]\sigma[/itex].
Calculate the probability density of the variable Y=exp(X). Calculate the mean and the variance of Y.


Homework Equations


Reichl's 2nd edition book page 180:
[itex]P_Y(y)=\sum _{-\infty}^{\infty} \delta (y-H(x))P_X(x)dx[/itex] where H(x)=Y, so I guess, H(x)=exp (x).


The Attempt at a Solution


I used the given formula and reached [itex]P_Y(y)=P_X (\ln y)[/itex]. Is this the correct answer?
I don't really know how to calculate the mean, [itex]\langle y \rangle[/itex]. I guess they want it in function of the mean of X, namely [itex]\langle x \rangle[/itex].
I know that [itex]\langle x \rangle=\int _{-\infty}^{\infty} xP_X(x)dx[/itex] and that [itex]\langle y \rangle=\int _{0}^{\infty} yP_Y(y)dy[/itex]. But this does not help me much. Any idea on how to continue further?
 

Answers and Replies

  • #2
Ray Vickson
Science Advisor
Homework Helper
Dearly Missed
10,706
1,728

Homework Statement


Let X be a continuous random variable with parameters [itex]\langle x \rangle[/itex] and [itex]\sigma[/itex].
Calculate the probability density of the variable Y=exp(X). Calculate the mean and the variance of Y.


Homework Equations


Reichl's 2nd edition book page 180:
[itex]P_Y(y)=\sum _{-\infty}^{\infty} \delta (y-H(x))P_X(x)dx[/itex] where H(x)=Y, so I guess, H(x)=exp (x).


The Attempt at a Solution


I used the given formula and reached [itex]P_Y(y)=P_X (\ln y)[/itex]. Is this the correct answer?
I don't really know how to calculate the mean, [itex]\langle y \rangle[/itex]. I guess they want it in function of the mean of X, namely [itex]\langle x \rangle[/itex].
I know that [itex]\langle x \rangle=\int _{-\infty}^{\infty} xP_X(x)dx[/itex] and that [itex]\langle y \rangle=\int _{0}^{\infty} yP_Y(y)dy[/itex]. But this does not help me much. Any idea on how to continue further?
I hate using canned formulas without thoroughly understanding them, so I prefer to proceed from first principles. In this case, Y > 0 because exp(X) is never negative or zero. So, given a value y > 0 we have P{Y <= y} = P{exp(X) <= y} = P{X <= ln(y)} = F(ln(y)), where F is the cumulative distaribution of X. That is, FY(y) = FX(ln(y)). Now get the density of Y as fY(y) = d FY(y) /dy, which you can express in terms of fX. Now, even if we know m = EX and σ^2 = Var(X) that does not help: different fX, all having the same mean and variance, can give different values for EY and Var(Y). However, we can express EY and Var(Y) in terms of integrations involving y and fX(ln y).

RGV
 
  • #3
fluidistic
Gold Member
3,662
104
First let me thank you very much Ray for all the help so far.
I hate using canned formulas without thoroughly understanding them, so I prefer to proceed from first principles. In this case, Y > 0 because exp(X) is never negative or zero. So, given a value y > 0 we have P{Y <= y} = P{exp(X) <= y} = P{X <= ln(y)} = F(ln(y)), where F is the cumulative distaribution of X. That is, FY(y) = FX(ln(y)).
Ok this is what I've got, namely that [itex]P_Y(y)=P_X (\ln y)[/itex], using Dirac's delta.
Now get the density of Y as fY(y) = d FY(y) /dy, which you can express in terms of fX.
I am a bit lost here. Why do you take the derivative?
Now, even if we know m = EX and σ^2 = Var(X) that does not help: different fX, all having the same mean and variance, can give different values for EY and Var(Y). However, we can express EY and Var(Y) in terms of integrations involving y and fX(ln y).

RGV
Okay I'll try once I understand the previous point!
 
  • #4
Ray Vickson
Science Advisor
Homework Helper
Dearly Missed
10,706
1,728
First let me thank you very much Ray for all the help so far.Ok this is what I've got, namely that [itex]P_Y(y)=P_X (\ln y)[/itex], using Dirac's delta.

I am a bit lost here. Why do you take the derivative?


Okay I'll try once I understand the previous point!
Why the derivative? Well, F is the cumulative distribution, so to get the density you need to differentiate it! Surely you must know this.

RGV
 
  • #5
fluidistic
Gold Member
3,662
104
Why the derivative? Well, F is the cumulative distribution, so to get the density you need to differentiate it! Surely you must know this.

RGV
I had never read the term "cumulative distribution" before, nor does it appear in my textbook. But apparently it's "just" the distribution function and I had never seen the relationship between it and the probability density!
So it means that what I've done using the definition in the book is wrong. I'll work on this tomorrow as I must wake up in a few hours.
Thanks for the lesson.
 
  • #6
Ray Vickson
Science Advisor
Homework Helper
Dearly Missed
10,706
1,728
I had never read the term "cumulative distribution" before, nor does it appear in my textbook. But apparently it's "just" the distribution function and I had never seen the relationship between it and the probability density!
So it means that what I've done using the definition in the book is wrong. I'll work on this tomorrow as I must wake up in a few hours.
Thanks for the lesson.
It is true that the modifier 'cumulative' is often dropped nowadays, and we just say 'distribution function', but I was not sure what convention you or your book were following. However, I am shocked that you have not been exposed to the relation between the distribution function F and the density function f; that is absolutely one of the basic probability relations.

What you did might not have been wrong; maybe your book uses a different notation or terminology from everyone else. Rather than relying on words and names, you need to look instead at ideas and concepts.

RGV
 
  • #7
fluidistic
Gold Member
3,662
104
Ok I have more time for the next days for these problems.
I've checked my textbook, now I see the difference between the distribution function and the probability function, I also realize that the latter is the derivative of the former.
However, even though the book uses that same terminology, it still clearly says
Often we wish to find the probability density, not for the stochastic variable, X, but for some new stochastic variable, Y=H(x), where H(x) is a known function of X. The probability density, [itex]P_Y(y)[/itex], for the stochastic variable, Y, is defined as [itex]P_Y(y)=\int _{-\infty}^{\infty} \delta (y-H(x))P_X(x)dx[/itex]
And a few pages before,
Note that the probability density function is just the derivative of the distribution function, [itex]P_X(x)=dF_X(x)/dx[/itex]
So the book uses the same notation as yours. Yet I found out (using the cookbook formula), [itex]P_Y(y)=P_X (\ln y)[/itex] while you found out [itex]F_Y(y) = F_X(ln(y))[/itex] which are two different things.
I guess I haven't applied well the Dirac's delta then? Is the textbook wrong on that formula? Since my professor gave it in the course that seems rather strange, though possible of course.
 
  • #8
Ray Vickson
Science Advisor
Homework Helper
Dearly Missed
10,706
1,728
Ok I have more time for the next days for these problems.
I've checked my textbook, now I see the difference between the distribution function and the probability function, I also realize that the latter is the derivative of the former.
However, even though the book uses that same terminology, it still clearly says
And a few pages before,
So the book uses the same notation as yours. Yet I found out (using the cookbook formula), [itex]P_Y(y)=P_X (\ln y)[/itex] while you found out [itex]F_Y(y) = F_X(ln(y))[/itex] which are two different things.
I guess I haven't applied well the Dirac's delta then? Is the textbook wrong on that formula? Since my professor gave it in the course that seems rather strange, though possible of course.
You need to be very, very careful about using things like ##\delta(y - H(x))## in an x-integral; that is why you obtained the wrong answer. Essentially, you need to change variables to z = H(x), with $$dz = H'(x) dx \longrightarrow
dx = \frac{dz}{H'(H^{-1}(z))}.$$ For H(x) = exp(x), this implies
$$ dz = z dx, \longrightarrow dx = dz/z.$$ We thus get
$$ \int \delta(y - H(x)) f_X(x) \, dx = \int \delta(y - z) f_X(\ln z) \frac{dz}{z}
= \frac{1}{y} f_X(\ln y).$$ This is exactly what you get if you apply the method I suggested before. It disagrees with your computation.

Because use of the δ is so tricky, I prefer to avoid it like the plague. However, use it if you want, but be careful.

RGV
 
  • #9
fluidistic
Gold Member
3,662
104
You need to be very, very careful about using things like ##\delta(y - H(x))## in an x-integral; that is why you obtained the wrong answer. Essentially, you need to change variables to z = H(x), with $$dz = H'(x) dx \longrightarrow
dx = \frac{dz}{H'(H^{-1}(z))}.$$ For H(x) = exp(x), this implies
$$ dz = z dx, \longrightarrow dx = dz/z.$$ We thus get
$$ \int \delta(y - H(x)) f_X(x) \, dx = \int \delta(y - z) f_X(\ln z) \frac{dz}{z}
= \frac{1}{y} f_X(\ln y).$$ This is exactly what you get if you apply the method I suggested before. It disagrees with your computation.

Because use of the δ is so tricky, I prefer to avoid it like the plague. However, use it if you want, but be careful.

RGV
Ok thank you infinitely for this. I've just played around with Dirac's delta and found an "intuitive way" (for me at least) not to fall into the trap I've fell over.
If you're interested here is how I think about it: [itex]\int _{-\infty} ^{\infty} \delta (y-e^{x})P_X(x)dx[/itex]. Now I need to get the argument of the Dirac's delta equal to 0. This implies [itex]x=\ln y[/itex]. If I replace x by ln y in the expression, the dx becomes [itex]d \ln y = \frac{dy}{y}[/itex]. So that the integral is simply worth [itex]\frac{1}{y}P_X(\ln y)=P_Y(y)[/itex].
Edit: Ok this would answer the first question.
For the mean value, I get that [itex]\langle Y \rangle =\int _{-\infty} ^{\infty} y P_Y(y)dy= \int _0 ^{\infty} P_X (\ln y ) dy[/itex]. If I'm not wrong this is worth 1??!! Because the distribution is supposed to be normalized. (details: [itex]\int _0 ^{\infty} P_X (\ln y ) dy=\int _{-\infty}^{\infty}P_X(y)dy[/itex] but since y is a dummy variable, this is equal to [itex]\int _{-\infty}^{\infty}P_X(x)dx[/itex] and I'm sure this is worth 1.)
 
Last edited:
  • #10
Ray Vickson
Science Advisor
Homework Helper
Dearly Missed
10,706
1,728
Ok thank you infinitely for this. I've just played around with Dirac's delta and found an "intuitive way" (for me at least) not to fall into the trap I've fell over.
If you're interested here is how I think about it: [itex]\int _{-\infty} ^{\infty} \delta (y-e^{x})P_X(x)dx[/itex]. Now I need to get the argument of the Dirac's delta equal to 0. This implies [itex]x=\ln y[/itex]. If I replace x by ln y in the expression, the dx becomes [itex]d \ln y = \frac{dy}{y}[/itex]. So that the integral is simply worth [itex]\frac{1}{y}P_X(\ln y)=P_Y(y)[/itex].
Edit: Ok this would answer the first question.
For the mean value, I get that [itex]\langle Y \rangle =\int _{-\infty} ^{\infty} y P_Y(y)dy= \int _0 ^{\infty} P_X (\ln y ) dy[/itex]. If I'm not wrong this is worth 1??!! Because the distribution is supposed to be normalized. (details: [itex]\int _0 ^{\infty} P_X (\ln y ) dy=\int _{-\infty}^{\infty}P_X(y)dy[/itex] but since y is a dummy variable, this is equal to [itex]\int _{-\infty}^{\infty}P_X(x)dx[/itex] and I'm sure this is worth 1.)
That is exactlywhat I did above.

RGV
 
  • #11
fluidistic
Gold Member
3,662
104
That is exactlywhat I did above.

RGV
Yes I know :) I kind of reformulated what you wrote into my own "words".
What do you think about the mean value I found?
 
Top