-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Incorrect computation of quantiles of vector of infinities #19542
Comments
Is this sufficient? |
I believe that is the behavior that Simon has in mind. Do you have a modification of the code that produces that result? |
It is already doing that. |
I see. Then, no, I think Simon wants his case and similar cases to be handled and not only the single-element of |
Also,
I am not sure what it means to find |
I think More generally, something like this should also return quantile([-0.817856,0.584222,4.40526,-3.11349,1.31774,-2.48744,Inf,Inf,2.40881,-1.25807,1.37004], 0.95) For both of these cases, I believe the operation is mathematically well-defined, and R, NumPy, and MATLAB all return |
Just to be sure, what you mean is that these operations are well-defined given the standard ordering on the extended real line, right? |
Wow, I did not mean to digress to measure theory. I have been eager to find a intro issue in Julia to dig my teeth into. I just wanted to make sure that this was desired functionality before I started working on it. If it is expected functionality in R, NumPy, and Matlab then I would not mind attempting it in Julia. |
I don't think you need to deal with measure theory, just with the idea that But it seems clear we should make sure there's broad consensus on what the correct behavior of both |
I don't think there is a good reason to produce the |
Adding a check for |
I would love to! Thanks! |
While we're at it we should probably make these consistent: julia> quantile([Inf,1.0],0.5)
Inf
julia> quantile([-Inf,1.0],0.5)
NaN Need to think of a good way to do this though. |
Though that appears to be my fault (#16572 and JuliaStats/StatsBase.jl#164 (comment)) |
is this closed by #19574 or is there any more to do here? |
The issue @simonbyrne mentions is not fixed. I think we might have to check |
I agree. That is a good way to solve the problem. I can work on that. |
Seems to have been fixed by #19659. |
I think this should be
Inf
, which is whatmedian
returns.The text was updated successfully, but these errors were encountered: