# Thread: need help for getting inverse of cdf from odd pdf

1. ## need help for getting inverse of cdf from odd pdf

I need help with the following problem

I have a pdf of: f(s|k)=k*s^(k-1) where k is a constanct between 0<k<1 and s is between 0≤s≤1.

I am trying to take random draws from this distribution, ( i.e. I am looking for the inverse of the cdf of this function). I know that this is not a proper pdf, so does it need to be transformed first? What I am looking for, in case of a standard normal distribution, it would be the normsinv() function in excel.

2. Originally Posted by keeper
I need help with the following problem

I have a pdf of: f(s|k)=k*s^(k-1) where k is a constanct between 0<k<1 and s is between 0≤s≤1.

I am trying to take random draws from this distribution, ( i.e. I am looking for the inverse of the cdf of this function). I know that this is not a proper pdf, so does it need to be transformed first? What I am looking for, in case of a standard normal distribution, it would be the normsinv() function in excel.
You can use the probability integral transform theorem on a random sample from a standard uniform distribution to generate a random sample from your probability distribution. You will need to normalise your 'pdf', calculate it's cdf F and then find $F^{-1}$.

3. Thanks for your reply. I know the steps I have to take, however, I do not know how to get a proper "normalized" pdf and cdf from this function. Can you help me with that? Maybe by giving me the exact functions?

4. Originally Posted by keeper
Thanks for your reply. I know the steps I have to take, however, I do not know how to get a proper "normalized" pdf and cdf from this function. Can you help me with that? Maybe by giving me the exact functions?
You find:

$\displaystyle F(s|k)=\int_{\xi=0}^s k\xi^{k-1}\; d\xi,\ \ \ 0\le s\le 1$

Then you find $k$ so that $F(1|k)=1$ (but that is true for all real $k$).

CB

5. Originally Posted by keeper
Thanks for your reply. I know the steps I have to take, however, I do not know how to get a proper "normalized" pdf and cdf from this function. Can you help me with that? Maybe by giving me the exact functions?
CaptainBlack has shown what to do to get the normalised pdf f(x). Where exactly are you stuck in finding the cdf F(x)?

6. Why does this need to be normalized exactly? It looks like a valid pdf to me.

This pdf is not "odd" at all; it is the pdf of a Beta(k, 1). The inverse cdf is given by betainv in excel, although you can invert this special case in closed form with no hassle.