PyTorch-based implementations of the Continuously-Ranked Probability Score (CRPS) as well as its locally scale-invariant version (SCRPS)
The CRPS is a strictly proper scoring rule.
It assesses how well a distribution with the cumulative distribution function
where
In Section 2 of this paper Zamo & Naveau list 3 different formulations of the CRPS. One of them is
which can be shortened to
where
The SCRPS is a locally scale-invariant version of the CRPS. In their paper, Bolling & Wallin define it in a positively-oriented, i.e., higher is better. In contrast, I implement the SCRPS in this repo negatively-oriented, just like a loss function.
Oversimplifying the notation, the (negatively-oriented) SCRPS can be written as
which can be shortened to
The scale-invariance, i.e., the SCRPS value does not depend on the magnitude of
Note that the SCRPS can, in contrast to the CRPS, yield negative values.
- Hersbach, "Decomposition of the Continuous Ranked Probability Score for Ensemble Prediction Systems"; 2000
- Gneiting et al.; "Calibrated Probabilistic Forecasting Using Ensemble Model Output Statistis and Minimum CRPS Estimation"; 2004
- Gneiting & Raftery; "Strictly Proper Scoring Rules, Prediction, and Estimation"; 2007
- Zamo & Naveau; "Estimation of the Continuous Ranked Probability Score with Limited Information and Applications to Ensemble Weather Forecasts"; 2018
- Jordan et al.; "Evaluating Probabilistic Forecasts with scoringRules"; 2019
- Bollin & Wallin; "Local scale invariance and robustness of proper scoring rules"; 2029
- Olivares & Négiar & Ma et al; "CLOVER: Probabilistic Forecasting with Coherent Learning Objective Reparameterization"; 2023
- Vermorel & Tikhonov; "Continuously-Ranked Probability Score (CRPS)" blog post; 2024
- Nvidia; "PhysicsNeMo Framework" source code; 2025
- Zheng & Sun; "MVG-CRPS: A Robust Loss Function for Multivariate Probabilistic Forecasting"; 2025
The CRPS, as well as the SCRPS, can be used as a loss function in machine learning, just like the well-known negative log-likelihood loss which is the log scoring rule.
The parametrized model outputs a distribution
For processes over time and/or space, we need to estimate the CRPS for every point in time/space separately.
There is work on multi-variate CRPS estimation, but it is not part of this repo.
The direct implementation of the integral formulation is not suited to evaluate on a computer due to the infinite
integration over the domain of the random variable
The normalization-by-observation variants are improper solutions to normalize the CPRS values. The goal is to use the CPRS as a loss function in machine learning tasks. For that, it is highly beneficial if the loss does not depend on the scale of the problem. However, deviding by the absolute maximum of the observations is a bad proxy for doing this. I plan on removing these methods once I gained trust in my SCRPS implementation.
I found Nvidia's implementation of the CRPS for ensemble preductions in
👉 Please have a look at the documentation to get started.