public StatisticRange addAndMaxDistinctValues(StatisticRange other) { double newDistinctValues = max(distinctValues, other.distinctValues); return new StatisticRange(minExcludeNaN(low, other.low), maxExcludeNaN(high, other.high), newDistinctValues); }
private double overlappingDistinctValues(StatisticRange other) { double overlapPercentOfLeft = overlapPercentWith(other); double overlapPercentOfRight = other.overlapPercentWith(this); double overlapDistinctValuesLeft = overlapPercentOfLeft * distinctValues; double overlapDistinctValuesRight = overlapPercentOfRight * other.distinctValues; double minInputDistinctValues = minExcludeNaN(this.distinctValues, other.distinctValues); return minExcludeNaN(minInputDistinctValues, maxExcludeNaN(overlapDistinctValuesLeft, overlapDistinctValuesRight)); }
public StatisticRange addAndSumDistinctValues(StatisticRange other) { double newDistinctValues = distinctValues + other.distinctValues; return new StatisticRange(minExcludeNaN(low, other.low), maxExcludeNaN(high, other.high), newDistinctValues); }
public StatisticRange addAndCollapseDistinctValues(StatisticRange other) { double overlapPercentOfThis = this.overlapPercentWith(other); double overlapPercentOfOther = other.overlapPercentWith(this); double overlapDistinctValuesThis = overlapPercentOfThis * distinctValues; double overlapDistinctValuesOther = overlapPercentOfOther * other.distinctValues; double maxOverlappingValues = max(overlapDistinctValuesThis, overlapDistinctValuesOther); double newDistinctValues = maxOverlappingValues + (1 - overlapPercentOfThis) * distinctValues + (1 - overlapPercentOfOther) * other.distinctValues; return new StatisticRange(minExcludeNaN(low, other.low), maxExcludeNaN(high, other.high), newDistinctValues); }