Changeset 2844
- Timestamp:
- 02/19/10 18:51:36 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Modeling/3.2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Modeling/3.2/SimplePearsonCorrelationCoefficientEvaluator.cs
r2428 r2844 17 17 18 18 public override double Evaluate(double[,] values) { 19 try { 20 return Calculate(values); 21 } 22 catch (ArgumentException) { 23 return double.NegativeInfinity; 24 } 19 return Calculate(values); 25 20 } 26 21 -
trunk/sources/HeuristicLab.Modeling/3.2/SimpleStableCorrelationCoefficientEvaluator.cs
r2428 r2844 50 50 double pop_sd_y = Math.Sqrt(sum_sq_y / values.GetLength(0)); 51 51 double cov_x_y = sum_coproduct / values.GetLength(0); 52 double r = cov_x_y / (pop_sd_x * pop_sd_y); 53 return r * r; 52 53 if (pop_sd_x == 0.0 || pop_sd_y == 0.0) 54 return 0.0; 55 else { 56 double r = cov_x_y / (pop_sd_x * pop_sd_y); 57 return r * r; 58 } 54 59 } 55 60
Note: See TracChangeset
for help on using the changeset viewer.