Skip to content

Clarify the halfwidth mean-error difference sign#457

Open
Kkkakania wants to merge 2 commits into
xarray-contrib:mainfrom
Kkkakania:agent/document-halfwidth-me-sign
Open

Clarify the halfwidth mean-error difference sign#457
Kkkakania wants to merge 2 commits into
xarray-contrib:mainfrom
Kkkakania:agent/document-halfwidth-me-sign

Conversation

@Kkkakania

@Kkkakania Kkkakania commented Jul 12, 2026

Copy link
Copy Markdown

Description

Clarifies the sign convention behind the difference returned by halfwidth_ci_test.

The function consistently returns score(forecasts2) - score(forecasts1), but each score follows the selected metric argument convention. For mean error, xskillscore defines me(a, b) as mean(a - b) and halfwidth_ci_test calls it as me(observations, forecast). The resulting sign is therefore opposite to calculations that define error as forecast - observation. The sign does not change the significance decision because that comparison uses the absolute difference.

This documents the behavior reported in #413 without changing the existing statistical calculation.

Closes #413

Type of change

  • Bug fix (documentation clarification; no runtime behavior changes)

How Has This Been Tested?

  • uv run --extra test pytest --doctest-modules xskillscore/core/comparative.py -q (2 passed)
  • pre-commit on xskillscore/core/comparative.py (all applicable hooks passed)

Checklist (while developing)

  • The updated function documentation builds as a valid doctest module.

Pre-Merge Checklist (final steps)

  • Based on the current upstream main.

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.

Result of halfwidth_ci_test may not correct.

1 participant