Changeset 5275 for branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis/3.3/Operators/WeightedParentsQualityVarianceComparator.cs
- Timestamp:
- 01/11/11 15:03:46 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis/3.3/Operators/WeightedParentsQualityVarianceComparator.cs
r5265 r5275 28 28 using HeuristicLab.Parameters; 29 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 using HeuristicLab.Common; 30 31 31 32 namespace HeuristicLab.Problems.DataAnalysis.Operators { … … 61 62 } 62 63 64 [StorableConstructor] 65 protected WeightedParentsQualityVarianceComparator(bool deserializing) : base(deserializing) { } 66 protected WeightedParentsQualityVarianceComparator(WeightedParentsQualityVarianceComparator original, Cloner cloner) 67 : base(original, cloner) { 68 } 63 69 public WeightedParentsQualityVarianceComparator() 64 70 : base() { … … 75 81 Parameters.Add(new ScopeTreeLookupParameter<IntValue>("RightSideSamples", "The number of samples used to calculate the quality of the parent.")); 76 82 } 77 83 public override IDeepCloneable Clone(Cloner cloner) { 84 return new WeightedParentsQualityVarianceComparator(this, cloner); 85 } 78 86 public override IOperation Apply() { 79 87 double leftQuality = LeftSideParameter.ActualValue.Value; … … 114 122 double stat = (xmean - ymean) / Math.Sqrt(xvar / n + yvar / m); 115 123 double c = xvar / n / (xvar / n + yvar / m); 116 double df = (n - 1) * (m - 1) / ((m - 1) * AP.Math.Sqr(c) + (n - 1) * (1 - AP.Math.Sqr(c)));124 double df = (n - 1) * (m - 1) / ((m - 1) * alglib.math.sqr(c) + (n - 1) * (1 - alglib.math.sqr(c))); 117 125 if ((double)(stat) > (double)(0)) 118 p = 1 - 0.5 * ibetaf.incompletebeta(df / 2, 0.5, df / (df + AP.Math.Sqr(stat)));126 p = 1 - 0.5 * alglib.ibetaf.incompletebeta(df / 2, 0.5, df / (df + alglib.math.sqr(stat))); 119 127 else 120 p = 0.5 * ibetaf.incompletebeta(df / 2, 0.5, df / (df + AP.Math.Sqr(stat)));128 p = 0.5 * alglib.ibetaf.incompletebeta(df / 2, 0.5, df / (df + alglib.math.sqr(stat))); 121 129 double bothtails = 2 * Math.Min(p, 1 - p); 122 130 double lefttail = p;
Note: See TracChangeset
for help on using the changeset viewer.