private void PrepareEstimator() { _estimator = new LMEstimator(); //liczmy stddev double sum = 0; double howmany = 0; foreach (var data in _data) { _estimator.SetCoeffs(data.GetCoeffsData()); foreach (DataEntry dataEntry in data.GetData()) { double real = dataEntry.GetValue("TIME"); double esti = _estimator.EstimateValue(dataEntry); double temp = Math.Pow((real - esti), 2); sum += temp; howmany += 1.0; } } double std = sum / (howmany - 2); _estimator.SetStd(std); }