From b7e348eb9133448c83a6f353fbb43d2157391d56 Mon Sep 17 00:00:00 2001 From: Christoph Ruegg Date: Mon, 31 Mar 2014 20:30:06 +0200 Subject: [PATCH] Fit: expose optional intercept in Fit.MultiDim --- src/Numerics/Fit.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Numerics/Fit.cs b/src/Numerics/Fit.cs index 1669a883..f91695d2 100644 --- a/src/Numerics/Fit.cs +++ b/src/Numerics/Fit.cs @@ -64,10 +64,11 @@ namespace MathNet.Numerics /// /// Least-Squares fitting the points (X,y) = ((x0,x1,..,xk),y) to a linear surface y : X -> p0*x0 + p1*x1 + ... + pk*xk, /// returning its best fitting parameters as [p0, p1, p2, ..., pk] array. + /// If an intercept is added, its coefficient will be prepended to the resulting parameters. /// - public static double[] MultiDim(double[][] x, double[] y) + public static double[] MultiDim(double[][] x, double[] y, bool intercept = false) { - return MultipleRegression.NormalEquations(x, y); + return MultipleRegression.NormalEquations(x, y, intercept); } ///