Skip to content

Conversation

@tobiasbiegert
Copy link
Contributor

Overview

  • Add crps_csg0, the closed-form CRPS for a 0-censored, shifted Gamma distribution (Scheuerer & Hamill 2015, App. B).
  • Supports mixed discrete/continuous variables (e.g. precipitation) with mass at zero.

Implementation

  1. csg0 in scoringrules/core/crps/_closed.py
  2. Python API in scoringrules/_crps.py as sr.crps_csg0
  3. Exposed via __init__.py exports
  4. Docs in docs/api/crps.md

Testing

  • shift=0 matches crps_gamma
  • Numeric check for shift>0
  • Rate/scale interchangeability
  • Validation of argument errors

@sallen12
Copy link
Collaborator

sallen12 commented Aug 4, 2025

Thanks Tobi, looks good, sorry for taking so long to look at this. There is now a small merge conflict due to changes we've made to main (sorry about this). I can only address these by creating a new PR. The easiest solution would be if you merge with main on your local branch, solve the merge conflict, and push your changes. The only change should be to delete the old docs/api/crps.md file and add crps_csg0 in the relevant place (line 61, I think) in the new docs/reference.md file. I can then finally merge the PR.

Thanks a lot!

@sallen12 sallen12 requested a review from frazane September 9, 2025 15:13
Copy link
Owner

@frazane frazane left a comment

Choose a reason for hiding this comment

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

Hi Tobias, thanks very much for this contribution. Sorry for the delay, I just got back from holiday. Looks good to me, only a minor comment regarding references in the docstrings. Please fix that and we're good to merge! 👍

@frazane frazane merged commit 8213d20 into frazane:main Oct 2, 2025
8 checks passed
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.

3 participants