@Override public NormalEstimator aggregate(NormalEstimator toAggregate) throws Exception { m_SumOfWeights += toAggregate.m_SumOfWeights; m_SumOfValues += toAggregate.m_SumOfValues; m_SumOfValuesSq += toAggregate.m_SumOfValuesSq; if (toAggregate.m_Precision < m_Precision) { m_Precision = toAggregate.m_Precision; } computeParameters(); return this; }
@Override public NormalEstimator aggregate(NormalEstimator toAggregate) throws Exception { m_SumOfWeights += toAggregate.m_SumOfWeights; m_SumOfValues += toAggregate.m_SumOfValues; m_SumOfValuesSq += toAggregate.m_SumOfValuesSq; if (toAggregate.m_Precision < m_Precision) { m_Precision = toAggregate.m_Precision; } computeParameters(); return this; }
/** * Add a new data value to the current estimator. * * @param data the new data value * @param weight the weight assigned to the data value */ @Override public void addValue(double data, double weight) { if (weight == 0) { return; } data = round(data); m_SumOfWeights += weight; m_SumOfValues += data * weight; m_SumOfValuesSq += data * data * weight; computeParameters(); }
/** * Add a new data value to the current estimator. * * @param data the new data value * @param weight the weight assigned to the data value */ @Override public void addValue(double data, double weight) { if (weight == 0) { return; } data = round(data); m_SumOfWeights += weight; m_SumOfValues += data * weight; m_SumOfValuesSq += data * data * weight; computeParameters(); }