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

Fix wrong calculation of median and q95 in gmtbinstats #8243

Merged
merged 1 commit into from
Dec 29, 2023
Merged

Conversation

PaulWessel
Copy link
Member

See forum post for background on gmtbinstat problem (bug). In what appears to be a copy/paste error, the calculation taking an average (media if n is even) and quantile (weighted average if quantile is not exactly on a single value) then the index of the second array value was junk. Fixing this and of course q95 is always > median; well >= in the case we only have a sample of size 1.

See forum post for background. In what appears to be a copy/paste error, the calculation taking an average (media if n is even) and quantile (weighted average if quantile is not exactly on a single value) then the index of the second array value was junk.  Fixing this and of course q95 is always > median; well >= in the case we only have a sample of size 1.
@PaulWessel PaulWessel added the bug Something isn't working label Dec 29, 2023
@PaulWessel PaulWessel added this to the 6.5.0 milestone Dec 29, 2023
@PaulWessel PaulWessel self-assigned this Dec 29, 2023
@PaulWessel PaulWessel merged commit 7b7fb09 into master Dec 29, 2023
6 checks passed
@PaulWessel PaulWessel deleted the stat-mixup branch December 29, 2023 14:01
PaulWessel added a commit that referenced this pull request Dec 29, 2023
THe bugfix in #8243 meant the plots change a big, now with correct values for median andq95, etc.
PaulWessel added a commit that referenced this pull request Dec 29, 2023
THe bugfix in #8243 meant the plots change a big, now with correct values for median andq95, etc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants