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.
- 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
Hope this answer solves the issue you are facing.