- cdf: https://in.mathworks.com/help/stats/prob.normaldistribution.cdf.html
- normcdf: https://in.mathworks.com/help/stats/normcdf.html?searchHighlight=normcdf&s_tid=srchtitle_support_results_1_normcdf
- icdf: https://in.mathworks.com/help/stats/prob.normaldistribution.icdf.html
ICDF for values very close to one
2 views (last 30 days)
Show older comments
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?
I'd appreciate your help!
Cheers,
Cedric
0 Comments
Answers (1)
Ravi
on 19 Oct 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.
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!