Polynomial Curve Fit

<array>output =<series>.polyFit(<number>order)

This function returns two items.  The first is a data series containing a curve of order Order that best fits the calling data series.  The second is a data series containing the coefficients of the polynomial curve that was return as the first item.  The number of points in the calling data series must be greater than the specified Order in the function call.

Example:

var myFit = mySeries.polyFit(3)[0];

var myCoeffs = mySeries.polyFit(3)[1];

This example fits a polynomial curve of order 3 to mySeries and stores the fitted curve in myFit and the coefficients in myCoeffs.