Purpose: Perform the linear least-squares fit.

Requires as function arguments the two data columns and two point number boundaries. The optional boundaries allow you to use a subset of the data columns in the fit.

Each data column is usually passed to LinFit.Crunch in the form of a transient Datacol object. For example:

LinFit.Crunch(Cpiv.Datacol(2), Cpiv.Datacol(1))

The Datacol objects are produced by the calls to the Cpiv.Datacol() function. Analogous DataCol() ifunctions exist in the other Explain CURVE classes. An object is used to hold the data column so that details about data types and formats are encapsulated.

Be careful that related data columns are passed to LinFit.Crunch. If you are using LinFit for polarization-resistance calculations, the data columns should be extracted from the same Curve object. In this case the data columns match up: the Nth point in one column was measured simultaneously with the Nth point in the other column. If you extract data columns from two different Curve objects, you must make sure that the data columns are not mismatched.


LinFit.Crunch(X , Y, LowerBound, UpperBound)

The x-data.

Y DATACOL The y-data.
LowerBound INDEX Optional. The first point included in the fit. Must be non-negative and less than the UpperBound. The default value is zero.
UpperBound INDEX Optional. The last point included in the fit. Must be greater than LowerBound and less than the last point in the data columns.

Related Topics Link IconRelated Topics