## Types in MathNet.Numerics

Type Fit

Namespace MathNet.Numerics

Least-Squares Curve Fitting Routines

### Public Static Functions

#### ValueTuple<double, double, double, double>Curve(Double[] x, Double[] y, Func<double, double, double, double, double, double> f, double initialGuess0, double initialGuess1, double initialGuess2, double initialGuess3, double tolerance, int maxIterations)

Non-linear least-squares fitting the points (x,y) to an arbitrary function y : x -> f(p0, p1, p2, p3, x), returning its best fitting parameter p0, p1, p2 and p3.

#### ValueTuple<double, double, double, double, double>Curve(Double[] x, Double[] y, Func<double, double, double, double, double, double, double> f, double initialGuess0, double initialGuess1, double initialGuess2, double initialGuess3, double initialGuess4, double tolerance, int maxIterations)

Non-linear least-squares fitting the points (x,y) to an arbitrary function y : x -> f(p0, p1, p2, p3, p4, x), returning its best fitting parameter p0, p1, p2, p3 and p4.

#### ValueTuple<double, double, double>Curve(Double[] x, Double[] y, Func<double, double, double, double, double> f, double initialGuess0, double initialGuess1, double initialGuess2, double tolerance, int maxIterations)

Non-linear least-squares fitting the points (x,y) to an arbitrary function y : x -> f(p0, p1, p2, x), returning its best fitting parameter p0, p1 and p2.

#### doubleCurve(Double[] x, Double[] y, Func<double, double, double> f, double initialGuess, double tolerance, int maxIterations)

Non-linear least-squares fitting the points (x,y) to an arbitrary function y : x -> f(p, x), returning its best fitting parameter p.

#### ValueTuple<double, double>Curve(Double[] x, Double[] y, Func<double, double, double, double> f, double initialGuess0, double initialGuess1, double tolerance, int maxIterations)

Non-linear least-squares fitting the points (x,y) to an arbitrary function y : x -> f(p0, p1, x), returning its best fitting parameter p0 and p1.

#### Func<double, double>CurveFunc(Double[] x, Double[] y, Func<double, double, double, double, double, double, double> f, double initialGuess0, double initialGuess1, double initialGuess2, double initialGuess3, double initialGuess4, double tolerance, int maxIterations)

Non-linear least-squares fitting the points (x,y) to an arbitrary function y : x -> f(p0, p1, p2, p3, p4, x), returning a function y' for the best fitting curve.

#### Func<double, double>CurveFunc(Double[] x, Double[] y, Func<double, double, double, double, double, double> f, double initialGuess0, double initialGuess1, double initialGuess2, double initialGuess3, double tolerance, int maxIterations)

Non-linear least-squares fitting the points (x,y) to an arbitrary function y : x -> f(p0, p1, p2, p3, x), returning a function y' for the best fitting curve.

#### Func<double, double>CurveFunc(Double[] x, Double[] y, Func<double, double, double, double, double> f, double initialGuess0, double initialGuess1, double initialGuess2, double tolerance, int maxIterations)

Non-linear least-squares fitting the points (x,y) to an arbitrary function y : x -> f(p0, p1, p2, x), returning a function y' for the best fitting curve.

#### Func<double, double>CurveFunc(Double[] x, Double[] y, Func<double, double, double, double> f, double initialGuess0, double initialGuess1, double tolerance, int maxIterations)

Non-linear least-squares fitting the points (x,y) to an arbitrary function y : x -> f(p0, p1, x), returning a function y' for the best fitting curve.

#### Func<double, double>CurveFunc(Double[] x, Double[] y, Func<double, double, double> f, double initialGuess, double tolerance, int maxIterations)

Non-linear least-squares fitting the points (x,y) to an arbitrary function y : x -> f(p, x), returning a function y' for the best fitting curve.

#### ValueTuple<double, double>Exponential(Double[] x, Double[] y, DirectRegressionMethod method)

Least-Squares fitting the points (x,y) to an exponential y : x -> a*exp(r*x), returning its best fitting parameters as (a, r) tuple.

#### Func<double, double>ExponentialFunc(Double[] x, Double[] y, DirectRegressionMethod method)

Least-Squares fitting the points (x,y) to an exponential y : x -> a*exp(r*x), returning a function y' for the best fitting line.

#### ValueTuple<double, double>Line(Double[] x, Double[] y)

Least-Squares fitting the points (x,y) to a line y : x -> a+b*x, returning its best fitting parameters as (a, b) tuple, where a is the intercept and b the slope.

#### Func<double, double>LineFunc(Double[] x, Double[] y)

Least-Squares fitting the points (x,y) to a line y : x -> a+b*x, returning a function y' for the best fitting line.

#### doubleLineThroughOrigin(Double[] x, Double[] y)

Least-Squares fitting the points (x,y) to a line through origin y : x -> b*x, returning its best fitting parameter b, where the intercept is zero and b the slope.

#### Func<double, double>LineThroughOriginFunc(Double[] x, Double[] y)

Least-Squares fitting the points (x,y) to a line through origin y : x -> b*x, returning a function y' for the best fitting line.

#### ValueTuple<double, double>Logarithm(Double[] x, Double[] y, DirectRegressionMethod method)

Least-Squares fitting the points (x,y) to a logarithm y : x -> a + b*ln(x), returning its best fitting parameters as (a, b) tuple.

#### Func<double, double>LogarithmFunc(Double[] x, Double[] y, DirectRegressionMethod method)

Least-Squares fitting the points (x,y) to a logarithm y : x -> a + b*ln(x), returning a function y' for the best fitting line.

#### Double[]Polynomial(Double[] x, Double[] y, int order, DirectRegressionMethod method)

Least-Squares fitting the points (x,y) to a k-order polynomial y : x -> p0 + p1*x + p2*x^2 +... + pk*x^k, returning its best fitting parameters as [p0, p1, p2,..., pk] array, compatible with Polynomial.Evaluate. A polynomial with order/degree k has (k+1) coefficients and thus requires at least (k+1) samples.

#### Func<double, double>PolynomialFunc(Double[] x, Double[] y, int order, DirectRegressionMethod method)

Least-Squares fitting the points (x,y) to a k-order polynomial y : x -> p0 + p1*x + p2*x^2 +... + pk*x^k, returning a function y' for the best fitting polynomial. A polynomial with order/degree k has (k+1) coefficients and thus requires at least (k+1) samples.

#### Double[]PolynomialWeighted(Double[] x, Double[] y, Double[] w, int order)

Weighted Least-Squares fitting the points (x,y) and weights w to a k-order polynomial y : x -> p0 + p1*x + p2*x^2 +... + pk*x^k, returning its best fitting parameters as [p0, p1, p2,..., pk] array, compatible with Polynomial.Evaluate. A polynomial with order/degree k has (k+1) coefficients and thus requires at least (k+1) samples.

#### ValueTuple<double, double>Power(Double[] x, Double[] y, DirectRegressionMethod method)

Least-Squares fitting the points (x,y) to a power y : x -> a*x^b, returning its best fitting parameters as (a, b) tuple.

#### Func<double, double>PowerFunc(Double[] x, Double[] y, DirectRegressionMethod method)

Least-Squares fitting the points (x,y) to a power y : x -> a*x^b, returning a function y' for the best fitting line.