ICDF for values very close to one

2 visualizaciones (últimos 30 días)
Cedric Kotitschke
Cedric Kotitschke el 31 de Ag. de 2022
Respondida: Ravi el 19 de Oct. de 2023
Hey,
I have a problem where I have to transform random variables from the standard normal space to some other, arbitrary distribution.
They way I do this is the following: Given a standard normal random variable U, I compute the standard normal CDF to then use the inverse CDF of the target distribution to get the random variable X:
X = icdf(normcdf(U))
where ICDF is the ICDF of the target distribution and Φ is the standard normal CDF.
The issue I now face is that when Uis quite large (e.g. 10), the standard normal CDF function "normcdf" returns 1. This, however, leads to X = infinity.
How do I solve this problem? I know that "normcdf" has the option normcdf(U, 'upper') to get 1-P instead of P but still - how do I get X?
I'd appreciate your help!
Cheers,
Cedric

Respuestas (1)

Ravi
Ravi el 19 de Oct. de 2023
Hi Cedric Kotitschke,
I understand your concerns for large values of "U" as input. A large value of "U" results in "normcdf" to return one, and in turn this makes "icdf" function to return Infinity.
One potential way to handle this is, for large values of "U" explicitly set "X" to the upper bound of the target distribution.
X = icdf('target_distribution', normcdf(U), param1, param2, ...);
Here param1, param2, are the parameters that define the target distribution.
if U > max_value
X = upper_bound_of_target_distribution
end
Whenever U takes a large value, we set the value of X to be the upper bound of the target distribution.
Another way of doing this is, if you have an idea on the upper limit and lower limit of both the distributions, then you can normalize the U value such that it falls within the limit. Applying cdf, followed by icdf gives its corresponding value in the target distribution.
For more understanding on cdf, normcdf, and icdf, kindly refer to the below mentioned links.
Hope this answer solves the issue you are facing.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by