Cumulative distribution function of a function of a random variable
1 view (last 30 days)
Show older comments
Hi everyone
I have the following issue:
X is a random variable uniform between ![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/233917/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/233917/image.png)
The variable Y is a function of X:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/233918/image.png)
where α is a constant.
I can't solve the equation for X, so I can't find the cumulative distribution of Y analytically. Is there a possibility in Matlab to find the cdf of a function of a Random Variable with a known cdf?
Thanks for your help!
2 Comments
Accepted Answer
David Goodmanson
on 15 Aug 2019
Hi Franziska,
a = 1.2;
x = .2
y = a*(1+x)*(2/(1+ (1+x)^(1/(a-1))))^(a-1)
xx = (y/a)/(2-(y/a)^(1/(a-1)))^(a-1) -1 % inverse function f(y)
x = 0.2000
y = 1.2884
xx = 0.2000 % same
try some values ,,,
3 Comments
David Goodmanson
on 16 Aug 2019
Edited: David Goodmanson
on 16 Aug 2019
Hi Franzisca,
It's just equation manipulation of the kind that isn't done as much as it once was due to the rise of algorithms, symbolic computation and so forth. There is probably more detail here than you need, but I wanted to put down the whole process, including a false start since that was part of it.
The right hand side has three factors:
a, (1+x) and the more complicated one (2/(1 + (1+x)^(1/(a-1))))^(a-1)
Notice that x appears only as (1+x). Also notice that taking both sides of the eqn to the (1/(a-1)) power has two effects: it turns the second factor into (1+x)^(1/(a-1)) which has the same form as occurrence of x in the third factor. That's the key. It also makes the ^(a-1) power in the third factor go away. This looks promising.
Now we have
y^(1/(a-1)) = a^(1/(a-1)) (1+x)^(1/(a-1)) ( 2/(1 + (1+x)^(1/(a-1))) ).
Realize that the first factor can go to the left hand side and that we really should have divided both sides by 'a' before taking both sides to the (1/(a-1)) power. Make that adjustment, so now
(y/a)^(1/(a-1)) = (1+x)^(1/(a-1)) ( 2/(1+(1+x)^(1/(a-1))) )
Hide some distracting clutter by creating two new objects
(y/a)^(1/(a-1)) = y1
and (1+x)^(1/(a-1)) = x1
Now we have y1 = x1 (2/(1+x1))
Use high school algebra to solve for x1
x1 = y1/(2-y1)
Plug the identities back in
(1+x)^(1/(a-1)) = (y/a)^(1/(a-1)) (2-(y/a)^(1/(a-1)))
Solve for x by taking both sides to the (a-1) power and subtracting 1
x = (y/a)/(2-(y/a)^(1/(a-1)))^(a-1) -1
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!