-
-
Notifications
You must be signed in to change notification settings - Fork 291
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
Fixes to statistical recipes #1563
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really the right person to review this ;) If you have opinions on this @jkrumbiegel, please comment as well..Otherwise, I'd just leave this up to @piever to merge!
src/stats/distributions.jl
Outdated
- a list of samples, | ||
- an abstract distribution, e.g. `Normal(0, 1)`, | ||
- a distribution type, e.g. `Normal`. | ||
In the last case, the Q-Q plot by fitting that distribution type to the data `y`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sentence misses a word?
src/stats/distributions.jl
Outdated
The attribute `qqline` (defaults to `:R`) determines how to compute a fit line for the Q-Q plot. | ||
Possible values are the following. | ||
- `:identity` draws the identity line (useful to see `x` and `y` follow the same distribution). | ||
- `:fit` fits the line to the quantile pairs (useful to see if the distribution of `y` can be obtained from the distribution of `x` via an affine transformation). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe :fit and :quantile are not the best names. Both fit and both use quantiles it seems to me?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I'm renaming :quantile
to :robust
(that's how Base R calls it, see here under qq.line.type
). They say "least squares"
instead of :fit
, but I think that's a bit too technical.
src/stats/distributions.jl
Outdated
- `:identity` draws the identity line (useful to see `x` and `y` follow the same distribution). | ||
- `:fit` fits the line to the quantile pairs (useful to see if the distribution of `y` can be obtained from the distribution of `x` via an affine transformation). | ||
- `:quantile` is analogous to `:fit` but uses a quantile-based fitting method. | ||
- `:R` is an alias for `:quantile`, as that is the default behavior in `:R`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm I'm not sure if that's necessary to have two names for the same thing where one is R
. We don't do that in other places either, so maybe a comment that quantile is Rs default method is enough?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/stats/distributions.jl
Outdated
|
||
Graphical attributes are | ||
- `color` to control color of both line and markers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If markercolor is not also specified I guess?
src/stats/distributions.jl
Outdated
|
||
convert_arguments(::Type{<:QQPlot}, args...; kwargs...) = | ||
convert_arguments(Scatter, qqbuild(loc(args...)...); kwargs...) | ||
Shorthand for `qqplot(Normal, y)`. See [`qqplot`](@ref) for more details. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this @ref
stuff hasn't worked for a while, maybe since the switch to Franklin? At least I remember having to remove it in a bunch of places
Thanks for the review! I've addressed the feedback and added a NEWS entry on the renaming of the options for |
Actually, I do have one doubt regarding the default value for OTOH, I don' really like magically switching from one default to the other depending on the argument types. Should we just default to UPDATE: I'm becoming convinced that, for the sake of clarity, one should do the following two things.
(I've updated the PR to reflect this approach.) |
@piever I like the idea of omitting the line by default and forcing the user to take an explicit stand on which type they want. |
Co-authored-by: Phillip Alday <palday@users.noreply.github.com>
Planning to merge this in a few days if there are no additional concerns. To summarize the main API changes
|
Description
Fixes
qqnorm
,qqplot
, which were broken as they were converted to an oddScatter
plot type and that broke with the new internals. They now have a more sensible "standard" implementation as a new plot type.It also fixed plotting
StatsBase.Histogram
objects. They accidentally ended up having a gap between bars after ,#1223.Type of change
Delete options that do not apply:
Checklist
I have not added tests as it seems tests exist already (see https://github.com/JuliaPlots/Makie.jl/blob/master/test/statistical_tests.jl) but somehow they stopped being run. It is probably best to update those in a separate PR (it seems all of them need fixing, due to changes in the internals).