- Bugfix at Measures.crps
This commit is contained in:
parent
cda8ba80d4
commit
b783f7bb15
@ -231,13 +231,13 @@ def crps(targets, densities):
|
|||||||
l = len(densities.bins)
|
l = len(densities.bins)
|
||||||
n = 1
|
n = 1
|
||||||
Fa = heavyside_cdf(densities.bins, targets)
|
Fa = heavyside_cdf(densities.bins, targets)
|
||||||
_crps = sum([(densities.cdf(val) - Fa[val][0]) ** 2 for val in densities.bins])
|
_crps = sum([(densities.cummulative(val) - Fa[val][0]) ** 2 for val in densities.bins])
|
||||||
elif isinstance(densities, list):
|
elif isinstance(densities, list):
|
||||||
l = len(densities[0].bins)
|
l = len(densities[0].bins)
|
||||||
n = len(densities)
|
n = len(densities)
|
||||||
Fa = heavyside_cdf(densities[0].bins, targets)
|
Fa = heavyside_cdf(densities[0].bins, targets)
|
||||||
for df in densities:
|
for df in densities:
|
||||||
_crps += sum([(df.cdf(val) - Fa[val][0]) ** 2 for val in df.bins])
|
_crps += sum([(df.cummulative(val) - Fa[val][0]) ** 2 for val in df.bins])
|
||||||
|
|
||||||
return _crps / float(l * n)
|
return _crps / float(l * n)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user