public void NoisedSlopeAndIntercept() { var timeSeries = Helper.CreateTimeSeries(Intercept, Slope, true); var solver = new SimpleLinearRegression(); var model = solver.Run(timeSeries); Assert.That(model.Intercept, Is.EqualTo(Intercept).Within(0.01), "Incorrect intercept"); Assert.That(model.Slope, Is.EqualTo(Slope).Within(0.01), "Incorrect slope"); }
public void ExactSlopeAndIntercept() { var timeSeries = Helper.CreateTimeSeries(Intercept, Slope); var regression = new SimpleLinearRegression(); var model = regression.Run(timeSeries); Assert.That(model.Intercept, Is.EqualTo(Intercept), "Incorrect intercept"); Assert.That(model.Slope, Is.EqualTo(Slope), "Incorrect slope"); }