ROI Transformation; Naïve forecaster; Theil's U Statistic
This commit is contained in:
parent
72610e9dc3
commit
30ffb89465
@ -26,12 +26,11 @@ def mape_interval(targets, forecasts):
|
||||
|
||||
# Theil's U Statistic
|
||||
def U(targets, forecasts):
|
||||
#forecasts.insert(0,None)
|
||||
l = len(targets)
|
||||
naive = []
|
||||
y = []
|
||||
for k in np.arange(0,l-1):
|
||||
y.append(((targets[k+1]-forecasts[k])/targets[k]) ** 2)
|
||||
y.append(((forecasts[k] - targets[k+1])/targets[k]) ** 2)
|
||||
naive.append(((targets[k + 1] - targets[k]) / targets[k]) ** 2)
|
||||
return np.sqrt(sum(y)/sum(naive))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user