- Timestamp:
- 03/05/15 11:25:59 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Analysis.Statistics.Views/3.3/CorrelationView.cs
r12116 r12137 214 214 .Where(x => !double.IsNaN(x) && !double.IsNegativeInfinity(x) && !double.IsPositiveInfinity(x)); 215 215 216 if (!rowValues.Any() || !columnValues.Any() || i == j ||rowValues.Count() != columnValues.Count()) {216 if (!rowValues.Any() || !columnValues.Any() || rowValues.Count() != columnValues.Count()) { 217 217 dt[i, j] = double.NaN; 218 } else if (i == j) { 219 dt[i, j] = 1.0; 218 220 } else { 219 221 if (methodName == PearsonName) { 220 dt[i, j] = alglib.pearsoncorr2(rowValues.ToArray(), columnValues.ToArray());222 dt[i, j] = Math.Round(alglib.pearsoncorr2(rowValues.ToArray(), columnValues.ToArray()), 3); // for correlations it is usually sufficient to show only 3 digits 221 223 } else { 222 dt[i, j] = alglib.spearmancorr2(rowValues.ToArray(), columnValues.ToArray());224 dt[i, j] = Math.Round(alglib.spearmancorr2(rowValues.ToArray(), columnValues.ToArray()), 3); // for correlations it is usually sufficient to show only 3 digits 223 225 } 224 226 }
Note: See TracChangeset
for help on using the changeset viewer.