/// <param name="reference">The stats against which the deviation will be computed.</param> public VariableStats AddMeasurement(double value, VariableStats reference) { return(new VariableStats( _nrMeasurements + 1, _total + value, _devTotal + Math.Abs(value - reference.Avg), Math.Min(Min, value), Math.Max(Max, value) )); }
/// <summary> /// Update Stats to reflect the statistics gathered between now and the /// previous Refresh call. /// </summary> public void Refresh() { Stats = _measurements; _measurements = VariableStats.CreateNew(); CurrentValue = 0; }
public void AddMeasurement(double value) { _measurements = _measurements.AddMeasurement(value, Stats); }