LinearCurveFitter<T> Class

Represents an algorithm that calculates a linear least squares fit of a curve.

Definition

Namespace: Numerics.NET.Curves.Generic
Assembly: Numerics.NET.Generic (in Numerics.NET.Generic.dll) Version: 9.0.1
C#
public sealed class LinearCurveFitter<T> : CurveFitter<T>
where T : Object, INumberBase<T>
Inheritance
Object  →  CurveFitter<T>  →  LinearCurveFitter<T>

Type Parameters

T

Remarks

Use the LinearCurveFitter class to fit data to a curve by the method of least squares. The curve is specified by the Curve property. The parameters of this curve are modified to produce the best fit. The curve must be of a type that inherits from LinearCombination, This includes instances of Polynomial and ChebyshevSeries.

The data is supplied as Vector objects through the XValues and YValues properties.

By default, the observations are unweighted. You can supply a weighting method in two ways. You can set the WeightFunction property to a function of two variables delegate that computes the weight for each observation. The WeightFunctions class provides predefined delegates for the most common weight functions. Alternatively, you can set the individual weights by setting the WeightVector property to a Vector that contains the weight for each individual observation.

The Fit() method performs the actual curve fit. By default, a QR decomposition is used. You can change the default behavior by setting the Method property to one of the LinearLeastSquaresMethod values.

Constructors

Properties

BestFitParameters Gets the curve parameters corresponding to the best fit.
(Inherited from CurveFitter<T>)
Curve Gets the non-linear curve that is being fitted.
(Overrides CurveFitter<T>.Curve)
InitialGuess Gets or sets the initial value for the iteration.
(Inherited from CurveFitter<T>)
Method Gets or sets the method used to calculate the least-sqaures solution.
Residuals Gets the residuals for the observations.
(Inherited from CurveFitter<T>)
ScaleVector Gets or sets the vector used to scale the curve parameters.
(Inherited from CurveFitter<T>)
StandardError Gets the standard error of the curve fit.
(Inherited from CurveFitter<T>)
WeightFunction Gets or sets the weight function.
(Inherited from CurveFitter<T>)
WeightVector Gets or sets the weight vector.
(Inherited from CurveFitter<T>)
XValues Gets or sets the vector of x-values.
(Inherited from CurveFitter<T>)
YValues Gets or sets the vector of y-values.
(Inherited from CurveFitter<T>)

Methods

EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Fit Calculates the least-squares fit.
(Inherited from CurveFitter<T>)
GetConfidenceBandwidth(T) Gets the width of the confidence band around the best-fit curve at the specified point at the 95% confidence level.
(Inherited from CurveFitter<T>)
GetConfidenceBandwidth(T, Double) Gets the width of the confidence band around the best-fit curve at the specified point.
(Overrides CurveFitter<T>.GetConfidenceBandwidth(T, Double))
GetHashCodeServes as the default hash function.
(Inherited from Object)
GetPredictionBandwidth(T) Gets the width of the prediction band around the best-fit curve at the specified point at the 95% confidence level.
(Inherited from CurveFitter<T>)
GetPredictionBandwidth(T, Double) Gets the width of the prediction band around the best-fit curve at the specified point.
(Overrides CurveFitter<T>.GetPredictionBandwidth(T, Double))
GetStandardDeviations Gets the standard deviations.
(Inherited from CurveFitter<T>)
GetTypeGets the Type of the current instance.
(Inherited from Object)
GetVarianceCovarianceMatrix Returns the variance-covariance matrix of the fit.
(Inherited from CurveFitter<T>)
ToStringReturns a string that represents the current object.
(Inherited from Object)

See Also