TAChart: Fix divide-by-zero error in TFitSeries.

git-svn-id: trunk@62073 -
This commit is contained in:
wp 2019-10-18 11:15:35 +00:00
parent 9107baee24
commit 6d317e22dc

View File

@ -332,7 +332,10 @@ begin
ycalc := CalcBestFitValues(x, y, n, m, FitParams);
CalcSumOfSquares(y, dy, ycalc, Result.SSE, Result.SSR);
SetLength(ycalc, 0);
chi2 := Result.SSE / (n - mfit);
if n > mfit then
chi2 := Result.SSE / (n - mfit)
else
chi2 := NaN;
// Calculate inverse of alpha. This is (almost) the variance-covariance matrix
invgen(mfit, mfit, alpha[0], term);