C# Class GSF.NumericalAnalysis.CurveFit

Linear regression algorithm.
Show file Open project: GridProtectionAlliance/gsf Class Usage Examples

Public Methods

Method Description
Compute ( int polynomialOrder, IEnumerable values ) : double[]

Computes linear regression over given values.

LeastSquares ( double zValues, double xValues, double yValues, double &a, double &b, double &c ) : void

Uses least squares linear regression to estimate the coefficients a, b, and c from the given (x,y,z) data points for the equation z = a + bx + cy.

Private Methods

Method Description
Compute ( int polynomialOrder, IList xValues, IList yValues ) : double[]

Method Details

Compute() public static method

Computes linear regression over given values.
public static Compute ( int polynomialOrder, IEnumerable values ) : double[]
polynomialOrder int An for the polynomial order.
values IEnumerable A list of values.
return double[]

LeastSquares() public static method

Uses least squares linear regression to estimate the coefficients a, b, and c from the given (x,y,z) data points for the equation z = a + bx + cy.
public static LeastSquares ( double zValues, double xValues, double yValues, double &a, double &b, double &c ) : void
zValues double z-value array
xValues double x-value array
yValues double y-value array
a double the out a coefficient
b double the out b coefficient
c double the out c coefficient
return void