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

use standard normal for QQNorm #1277

Merged
merged 2 commits into from Sep 30, 2021
Merged

use standard normal for QQNorm #1277

merged 2 commits into from Sep 30, 2021

Conversation

palday
Copy link
Contributor

@palday palday commented Aug 29, 2021

In usual statistical practice, qqnorm plots are plotted against the quantiles of the standard normal and not against a normal distribution fitted to the data. This changes the behavior of qqnorm to use the standard normal as the reference distribution. I'm somewhat unsure at the moment about the tick labels, but perhaps @dmbates can comment (who brought this issue to my attention).

There is an additional friction point introduced by this change: the default y=x line shown in the qqnorm plot is now ridiculous for empirical distributions that aren't unit scaled. I realize that this uses qqbuild from Distributions, but perhaps changing the values to be on the quantile/CDF scale instead of the raw scale might help (that ties into the axis labeling as well).

This type of plot also greatly benefits from a default 1:1 aspect, but I don't know how to make that change quickly.

I'm unsure whether this counts as a breaking change or just a bugfix.

@piever
Copy link
Contributor

piever commented Aug 30, 2021

That makes sense, I guess plotting against a standard normal adds some extra information (makes it easier to get a sense of the standard deviation of the empirical distribution).

Re changing the fit line, I think you can just do something like

convert_arguments(::Type{<:QQNorm}, v; qqline=:fit) =
    convert_arguments(QQPlot, Distributions.Normal(), v; qqline=qqline)

so that QQNorm has a different default than QQPlot, which I think is reasonable. I imagine the typical use case of QQPlot is to test whether two distributions are equal, rather than equal up to shift and rescale (I may be wrong though).

This type of plot also greatly benefits from a default 1:1 aspect, but I don't know how to make that change quickly.

Changing axis attributes within a recipe is not yet supported as far as I know, so this may need to wait for that.

@dmbates
Copy link

dmbates commented Aug 31, 2021

Thanks for raising the issue, @palday. I am still a bit confused about the structure of the code but we can get a chance to discuss it over the next couple of weeks.

@SimonDanisch SimonDanisch merged commit 6e0ced5 into MakieOrg:master Sep 30, 2021
@palday palday mentioned this pull request Jan 15, 2022
2 tasks
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

Successfully merging this pull request may close these issues.

None yet

4 participants