/// <summary> /// 计算中误差并赋值。 /// </summary> /// <param name="errors">误差序列</param> public void SetRms(double[] errors) { RmsCalculator rmsCalculator = new RmsCalculator(errors); rmsCalculator.Calculate(); this.Rms = rmsCalculator.Rms; }
/// <summary> /// 线性粗差探测器。构造函数。 /// </summary> /// <param name="residuals">数据残差,误差。</param> public GrossErrorFilter(IEnumerable <Double> residuals) { this.Residuals = residuals; RmsCalculator rmsCalculator = new RmsCalculator(residuals); rmsCalculator.Calculate(); this.Rms = rmsCalculator.Rms; }
/// <summary> /// 线性粗差探测器。构造函数。 /// </summary> /// <param name="residuals">数据残差,误差。</param> public DicGrossErrorFilter(Dictionary <Double, Double> residuals) { this.Residuals = residuals; RmsCalculator rmsCalculator = new RmsCalculator(residuals.Values); rmsCalculator.Calculate(); this.Rms = rmsCalculator.Rms; }
/// <summary> /// 构造函数 /// </summary> /// <param name="residuals">数据残差</param> public ResidualAnalysiser(double[] residuals) { this.Residuals = residuals; this.Count = this.Residuals.Length; //绝对值的平均数 double averageOfAbs = 0; foreach (var item in this.Residuals) { averageOfAbs += Math.Abs(item) / this.Count; } this.AverageOfAbs = averageOfAbs; RmsCalculator = new RmsCalculator(residuals); RmsCalculator.Calculate(); this.Rms = RmsCalculator.Rms; }