-
Notifications
You must be signed in to change notification settings - Fork 423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
inv*
functions are not really inverses
#1813
Comments
Please try to outline the behavior that you are proposing? Are you proposing that the |
I have problems understanding this example and the problem in general. CDF of |
It's the other way around: julia> d = Uniform(0, 1)
julia> f(x) = logcdf(d, x)
julia> invf(x) = invlogcdf(d, x)
# isn't an inverse in either of the directions:
julia> f(invf(5))
0.0
julia> invf(f(5))
1.0
I'm not proposing any specific solution, just pointing out an issue with these functions that are called "inverse" but actually aren't. Leaving the decision on what the fix should be to Distributions.jl devs. |
The function Value EDIT. Maybe to rephrase it differently: quantile function acts on probabilities. Asking what corresponds to probability -500% or 500% does not have sense, but numerically of course can happen. But then, returning the lowest or highest values which the distribution can generate, i.e. |
It seems what the docstring for I think Distributions uses the definition I suggest we can resolve this by adding a note in the docstring that |
@sethaxen I checked before. As written in the Wikipedia article that you mention, quantile function is defined for |
I don't see any good reason to extend the support of
One could definte |
It is speculation, but the reason for |
I proposed changes to the docs in #1814 |
There is an inconsistency between the documentation (and name) of functions like
invlogcdf
and their actual behavior. They are claimed to be inverses (tologcdf
), so should presumably error when inverting is not possible. However, they still return some result in these cases, which definitely isn't the proper inverse:The text was updated successfully, but these errors were encountered: