Gemstone Numeric Library
Show/Hide TOC

# CurveFitLeastSquares(Double, Double, Double, Double, Double, Double) 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.

## Definition

Namespace: Gemstone.Numeric.Analysis
Assembly: Gemstone.Numeric (in Gemstone.Numeric.dll) Version: 1.0.171 -- Release Build+20915b5e5c2b832e94890ea4187a61c474a2582a
C#
View Source Request Example

    public static void LeastSquares(
    	double[] zValues,
    	double[] xValues,
    	double[] yValues,
    	out double a,
    	out double b,
    	out double c
    )

VB
View Source Request Example

    Public Shared Sub LeastSquares (
    	zValues As Double(),
    	xValues As Double(),
    	yValues As Double(),
    	<OutAttribute> ByRef a As Double,
    	<OutAttribute> ByRef b As Double,
    	<OutAttribute> ByRef c As Double
    )

C++
View Source Request Example

    public:
    static void LeastSquares(
    	array<double>^ zValues,
    	array<double>^ xValues,
    	array<double>^ yValues,
    	[OutAttribute] double% a,
    	[OutAttribute] double% b,
    	[OutAttribute] double% c
    )

JavaScript
View Source Request Example

    Gemstone.Numeric.Analysis.CurveFit.LeastSquares = function(zValues, xValues, yValues, a, b, c);

#### Parameters

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

## See Also

#### Reference

CurveFit Class
LeastSquares Overload
Gemstone.Numeric.Analysis Namespace