From 30ffb89465ffd8d60e80679c32c4e2bc8016ac71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=C3=B4nio=20C=C3=A2ndido=20de=20Lima=20e=20Silva?= Date: Mon, 23 Jan 2017 09:26:33 -0200 Subject: [PATCH] =?UTF-8?q?ROI=20Transformation;=20Na=C3=AFve=20forecaster?= =?UTF-8?q?;=20Theil's=20U=20Statistic?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- benchmarks/Measures.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/benchmarks/Measures.py b/benchmarks/Measures.py index f3893d6..e9b8f13 100644 --- a/benchmarks/Measures.py +++ b/benchmarks/Measures.py @@ -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))