From 70735d8d7914ef47db1f74da047093e094e70870 Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Mon, 18 Apr 2011 12:36:02 +0200 Subject: [PATCH] Ignore extra samples in reported nruns --- regress.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/regress.c b/regress.c index af69e11..e78fafe 100644 --- a/regress.c +++ b/regress.c @@ -299,6 +299,10 @@ RGR_FindBestRegression nruns = n_runs_from_residuals(resid, n - resid_start); if (nruns > critical_runs[n - resid_start] || n - start <= MIN_SAMPLES_FOR_REGRESS) { + if (resid_start < 0) { + /* Ignore extra samples in returned nruns */ + nruns = n_runs_from_residuals(resid - resid_start, n); + } break; } else { /* Try dropping one sample at a time until the runs test passes. */