LinFit.Crunch()

<< Click to Display Table of Contents >>

Navigation:  Explain™ Control Language  > Library Routines > Mathematical classes > class LINFIT >

LinFit.Crunch()

Description

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.

 

Gamry tip bulb

Make sure 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.

 

Type

INSTANCE FUNCTION

 

Usage

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

 

X

DATACOL

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.