Skip to content
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

cquantile on iterables #158

Open
yuvalwas opened this issue Nov 13, 2023 · 3 comments
Open

cquantile on iterables #158

yuvalwas opened this issue Nov 13, 2023 · 3 comments

Comments

@yuvalwas
Copy link

Hello,
It is a minor thing, but since it already exists, I thought it makes sense that cquantile would be defined for this case as well. To be specific, at the moment cquantile(rand(1000), 0.9) has no method, but it could return quantile(rand(1000), 0.1).
Thanks

@devmotion devmotion transferred this issue from JuliaStats/Distributions.jl Nov 13, 2023
@nalimilan
Copy link
Member

@devmotion Why did you transfer this to Statistics? cquantile lives in Distributions.jl, and quantile already accepts any iterator.

@devmotion
Copy link
Member

devmotion commented Dec 10, 2023

Distributions only wants and implements quantile(::UnivariateDistribution, ::Real), and similarly only cquantile(::UnivariateDistribution, ::Real) is of interest there. But methods such as quantile(::AbstractArray, p) (with all its keyword arguments) do not belong in Distributions, and hence similarly IMO something like cquantile(::AbstractArray, ::Real) does not belong there but (if it is desired) next to where quantile(::AbstractArray, ::Real) is defined.

@nalimilan
Copy link
Member

Got it. That makes sense, though I'm not totally convinced it's worth adding a function just to avoid typing 1-p. Do we know why that function judged useful enough to be added to Distributions in the first place?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants