NMath User's Guide

TOC | Previous | Next | Index

31.2 Properties of PolynomialLeastSquares (.NET, C#, CSharp, VB, Visual Basic, F#)

Once constructed, a PolynomialLeastSquares object provides the following properties:

FittedPolynomial gets the fitted Polynomial object.

Coefficients gets the coeffients of the fitted polynomial. The constant is at index 0, and the leading coefficient is at index Coefficients.Length -1.

Degree gets the degree of the fitted polynomial.

LeastSquaresSolution gets the DoubleLeastSquares object used to compute the coefficients.

DesignMatrix gets the design matrix for the fit.

Finally, the CoeffErrorEstimate() method returns a vector of error estimates for the coefficients based on a given estimated error in the y-values. For example:

Code Example – C# polynomial fit

Console.WriteLine( fit.CoeffErrorEstimate(0.01) );

Code Example – VB polynomial fit

Console.WriteLine( Fit.CoeffErrorEstimate(0.01) )