LFIT

Purpose:

Fits a line to a series using only the end points.

Syntax:

LFIT(series)

series

-

A series or array.

Returns:

A series.

Example:

W1: integ(gnorm(1000,1))

W2: lfit(W1);overplot(W1, lred)

 

W2 contains a linear fit of the data that exactly passes through the first and last point of W1. The resulting line is plotted with the original data.

Example:

W3: xy(W1, deriv(W1))

W4: lfit(W3);overplot(W3, lred)

 

W4 contains the end point linear fit to the XY data in W3.

Remarks:

The first and last points of the resulting line will always match the first and last points of the input series.

 

See LINREG and LINREG2 to fit a line to the data using the method of least squares.

See Also:

LINFIT

LINREG

LINREG2

POLYFIT

TREND