Documentation
A package to compute the continuous ranked probability score (crps) (Matheson and Winkler, 1976; Hersbach, 2000), the fair-crps (fcrps) (Ferro et al., 2008), and the adjusted-crps (acrps) (Ferro et al., 2008) given an ensemble prediction and an observation.
The CRPS is a negatively oriented score that is used to compare the empirical distribution of an ensemble prediction to a scalar observation.
Read documentation at https://github.com/gouthamnaveen/CRPS
References:
[1] Matheson, J. E. & Winkler, R. L. Scoring Rules for Continuous Probability Distributions. Management Science 22, 1087–1096 (1976).
[2] Hersbach, H. Decomposition of the Continuous Ranked Probability Score for Ensemble Prediction Systems. Wea. Forecasting 15, 559–570 (2000).
[3] Ferro, C. A. T., Richardson, D. S. & Weigel, A. P. On the effect of ensemble size on the discrete and continuous ranked probability scores. Meteorological Applications 15, 19–24 (2008).
Installation:
pip install CRPS
Parameters:
ensemble_members: numpy.ndarray
The predicted ensemble members. They will be sorted in ascending order automatically.
Ex: np.array([2.1,3.5,4.7,1.2,1.3,5.2,5.3,4.2,3.1,1.7])
observation: float
The observed scalar.
Ex: 5.4
adjusted_ensemble_size: int, optional
The size the ensemble needs to be adjusted to before computing the Adjusted Continuous Ranked Probability Score. The default is 200.
Note: The crps becomes equal to acrps when adjusted_ensemble_size equals the length of the ensemble_members.
Method(s):
compute():
Computes the continuous ranked probability score (crps), the fair-crps (fcrps), and the adjusted-crps (acrps).
Returns:
crps,fcrps,acrps
Attributes:
crps: Continuous Ranked Probability Score
It is the integral of the squared difference between the CDF of the forecast ensemble and the observation.
fcrps: Fair-Continuous Ranked Probability Score
It is the crps computed assuming an infinite ensemble size.
where m is the current ensemble size (i.e., len(ensemble_members))
acrps: Adjusted-Continuous Ranked Probability Score
It is the crps computed assuming an ensemble size of M.
where M is the adjusted_ensemble_size
Demonstration:
import numpy as np
import CRPS.CRPS as pscore
Example - 1:
In [1]: pscore(np.arange(1,5),3.5).compute()
Out[1]: (0.625, 0.4166666666666667, 0.42083333333333334)
Example - 2:
In [2]: crps,fcrps,acrps = pscore(np.arange(1,11),8.3,50).compute()
In [3]: crps
Out[3]: 1.6300000000000003
In [4]: fcrps
Out[4]: 1.446666666666667
In [5]: acrps
Out[5]: 1.4833333333333336
Release files for CRPS 2.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| CRPS-2.0.4.tar.gz | 7.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| CRPS-2.0.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.5 kB
Release files / CRPS-2.0.4.tar.gz
| Download URL | CRPS-2.0.4.tar.gz |
|---|---|
| Size | 7.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f0d24da83e4e5a0bb9e84927f068e525613579001bcccb76274e112f13511229
|
|
BLAKE2b-256 checksum How to use checksums |
ad79fa0b68194fb3112fc9320c2f03119d0d9e7d63226800b8617af233107b43
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.11.3 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.7.13
|
Release files / CRPS-2.0.4-py3-none-any.whl
| Download URL | CRPS-2.0.4-py3-none-any.whl |
|---|---|
| Size | 8.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2a1fd666702753ff9e1b951bcd958f9c5046eafc023b77df0bdf60539932ba0f
|
|
BLAKE2b-256 checksum How to use checksums |
65c3759461ea6293ec16f6a5a7a273f09225e18fa7b3f6d2c2878486a6ead83e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.11.3 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.7.13
|