Skip to content

BUG: Fix medcouple with ties - #5397

Merged
josef-pkt merged 1 commit into
statsmodels:masterfrom
bashtage:fix-medcouple-ties
Nov 27, 2018
Merged

josef-pkt merged 1 commit into
statsmodels:masterfrom
bashtage:fix-medcouple-ties

Conversation

@bashtage

Copy link
Copy Markdown
Member

Fix medcouple behaviour when there is an even number of ties

closes #5395

@coveralls

coveralls commented Nov 22, 2018 •

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.01%) to 84.233% when pulling 9984ca7 on bashtage:fix-medcouple-ties into 4a79c28 on statsmodels:master.

Comment thread statsmodels/stats/stattools.py Outdated
return np.median(spread / standardization)
h = spread / standardization
# GH5395
if np.any(lower == 0.0):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could create a temp mask to avoid repeated evaluation of lower == 0

@codecov

codecov Bot commented Nov 22, 2018 •

Copy link
Copy Markdown

Codecov Report

Merging #5397 into master will decrease coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #5397      +/-   ##
=========================================
- Coverage   81.73%   81.7%   -0.04%     
=========================================
  Files         569     569              
  Lines       89836   89840       +4     
  Branches    10027   10028       +1     
=========================================
- Hits        73427   73403      -24     
- Misses      14133   14159      +26     
- Partials     2276    2278       +2
Impacted Files Coverage Δ
statsmodels/stats/stattools.py 99.11% <100%> (+0.05%) ⬆️
statsmodels/stats/tests/test_statstools.py 100% <100%> (ø) ⬆️
statsmodels/iolib/openfile.py 66.66% <0%> (-9.1%) ⬇️
statsmodels/base/wrapper.py 86.95% <0%> (-4.35%) ⬇️
statsmodels/datasets/utils.py 80.24% <0%> (-3.09%) ⬇️
statsmodels/tsa/tsatools.py 87.3% <0%> (-2.48%) ⬇️
statsmodels/tsa/base/tsa_model.py 87.03% <0%> (-2.32%) ⬇️
statsmodels/iolib/tests/test_foreign.py 96.85% <0%> (-1.58%) ⬇️
statsmodels/iolib/foreign.py 71.23% <0%> (-1.39%) ⬇️
statsmodels/graphics/regressionplots.py 81.2% <0%> (-0.47%) ⬇️
... and 11 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4a79c28...9984ca7. Read the comment docs.

@josef-pkt

Copy link
Copy Markdown
Member

Implementation looks correct. (But I don't completely like the +1, -1 for ties in the 2004 article)

Fix medcouple behaviour when there is an even number of ties

closes statsmodels#5395
@josef-pkt
josef-pkt merged commit d775833 into statsmodels:master Nov 27, 2018
@josef-pkt

Copy link
Copy Markdown
Member

merged

@bashtage Thank you

@And-ZJ Thanks for reporting this

@josef-pkt josef-pkt added this to the 0.10 milestone Dec 5, 2018
@bashtage
bashtage deleted the fix-medcouple-ties branch May 1, 2019 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

'medcouple' function in stats.stattools may calculate a wrong answer?

3 participants