# Cumulative distribution function of a function of a random variable

2 views (last 30 days)
Franziska on 14 Aug 2019
Commented: Franziska on 16 Aug 2019
Hi everyone
I have the following issue:
X is a random variable uniform between
The variable Y is a function of X:
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?
Torsten on 15 Aug 2019
Edited: Torsten on 15 Aug 2019
As David shows, it is possible to solve your equation for X.
Thus you can get an analytical expression for the CFD of Y.
Franziska on 16 Aug 2019
True! Works perfectly. Thanks for the advice.

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 CommentsShow 1 older commentHide 1 older comment
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
Franziska on 16 Aug 2019
Fantastic! Thanks for explaining the steps, that was very helpful.