# ICDF for values very close to one

3 ビュー (過去 30 日間)
Cedric Kotitschke 2022 年 8 月 31 日

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:
where 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 .
How do I solve this problem? I know that "normcdf" has the option normcdf(U, 'upper') to get instead of P but still - how do I get X?
Cheers,
Cedric

サインインしてコメントする。

### 回答 (1 件)

Ravi 2023 年 10 月 19 日
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.

サインインしてコメントする。

### カテゴリ

Help Center および File ExchangeRayleigh Distribution についてさらに検索

R2021a

### Community Treasure Hunt

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

Start Hunting!

Translated by