CDF and Inverse CDF calculating

781 Views Asked by At

I am working on Monte-Carlo simulation. I decided to compare calculating of different functions with inverse CDF.

For example we have standard Gumbel distribution. Its cumulative distribution function is $F(x)=e^{−e^{−x}}$. So if we will compute such integral on the domain [0,1] we will receive the answer = 0.5400317077249.

For inverse transformation we need to recall natural logarithm function as an inverse of exponential function, so it is instantly obvious that quantile function for Gumbel distribution is $F^{−1}(p)=−\ln(−\ln(p))$, but if we will compute the final function $F(x)=e^{−e^{−(−\ln(−\ln(p)))}}$ on the same domain, uniformly distributed as $[0,1]$ the result will be 0.4999995231642060389 always.

Can somebody please help me to understand where is my mistake?

1

There are 1 best solutions below

4
On BEST ANSWER

Notice how you're really integrating $F(x) = x$ when you plug the inverse function into the original. That's not what we want. The relation between the integrals of $F(x)$ and $F^{-1}(p)$ is given by:

$$ \int\limits_a^bF(x)\,dx = bd - ac - \int\limits_c^dF^{-1}(p) \, dp $$

In our case, $F(x)$ maps $[0,1]$ onto $[e^{-1}, e^{-e^{-1}}]$. So,

$$ \int\limits_0^1F(x)\,dx = e^{-e^{-1}} - \int\limits_{e^{-1}}^{e^{-e^{-1}}} F^{-1}(p) \, dp \approx 0.540032$$

as desired.