You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Numerics/Fit.cs
+38Lines changed: 38 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -362,6 +362,24 @@ public static Tuple<double, double, double> Curve(double[] x, double[] y, Func<d
362
362
returnFindMinimum.OfFunction((p0,p1,p2)=>Distance.Euclidean(Generate.Map(x, t =>f(p0,p1,p2,t)),y),initialGuess0,initialGuess1,initialGuess2,tolerance,maxIterations);
363
363
}
364
364
365
+
/// <summary>
366
+
/// Non-linear least-squares fitting the points (x,y) to an arbitrary function y : x -> f(p0, p1, p2, p3, x),
367
+
/// returning its best fitting parameter p0, p1 and p2.
returnFindMinimum.OfFunction((p0,p1,p2,p3)=>Distance.Euclidean(Generate.Map(x, t =>f(p0,p1,p2,p3,t)),y),initialGuess0,initialGuess1,initialGuess2,initialGuess3,tolerance,maxIterations);
372
+
}
373
+
374
+
/// <summary>
375
+
/// Non-linear least-squares fitting the points (x,y) to an arbitrary function y : x -> f(p0, p1, p2, p3, x),
376
+
/// returning its best fitting parameter p0, p1 and p2.
returnFindMinimum.OfFunction((p0,p1,p2,p3,p4)=>Distance.Euclidean(Generate.Map(x, t =>f(p0,p1,p2,p3,p4,t)),y),initialGuess0,initialGuess1,initialGuess2,initialGuess3,initialGuess4,tolerance,maxIterations);
381
+
}
382
+
365
383
/// <summary>
366
384
/// Non-linear least-squares fitting the points (x,y) to an arbitrary function y : x -> f(p, x),
367
385
/// returning a function y' for the best fitting curve.
@@ -391,5 +409,25 @@ public static Func<double, double> CurveFunc(double[] x, double[] y, Func<double
0 commit comments