Changeset 2827
 Timestamp:
 02/18/10 13:52:57 (11 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/sources/HeuristicLab.Modeling/3.2/SimpleTheilInequalityCoefficientEvaluator.cs
r2357 r2827 34 34 35 35 where P_t is the predicted change of the target variable and A_t is the measured (original) change. 36 (P_t = y'_t  y_(t1), A_t = y_t y_(t1)).36 (P_t = (y'_t  y_(t1)) / y_(t1), A_t = (y_t  y_(t1)) / y_(t1)). 37 37 38 38 U2 is 0 for a perfect prediction and 1 for the naive model y'_t = y_(t1). An U2 > 1 means the … … 58 58 for (int sample = 1; sample < n; sample++) { 59 59 double prevValue = values[sample  1, ORIGINAL_INDEX]; 60 double estimatedChange = values[sample, ESTIMATION_INDEX]  prevValue; 61 double originalChange = values[sample, ORIGINAL_INDEX]  prevValue; 62 if (!double.IsNaN(originalChange) && !double.IsInfinity(originalChange)) { 63 double error = estimatedChange  originalChange; 64 errorsSquaredSum += error * error; 65 originalSquaredSum += originalChange * originalChange; 60 double estimatedValue = values[sample, ESTIMATION_INDEX]; 61 double originalValue = values[sample, ORIGINAL_INDEX]; 62 if (!double.IsNaN(originalValue) && !double.IsInfinity(originalValue)) { 63 double errorEstimatedChange = (estimatedValue  originalValue) / prevValue; // percentage error of predicted change 64 errorsSquaredSum += errorEstimatedChange * errorEstimatedChange; 65 double errorNoChange = (prevValue  originalValue) / prevValue; // percentage error of naive model y(t+1) = y(t) 66 originalSquaredSum += errorNoChange * errorNoChange; 66 67 nSamples++; 67 68 }
Note: See TracChangeset
for help on using the changeset viewer.