ScatterPlot.CreatePolyCurve

Prototypes

void CreatePolyCurve( int nDegree <, int nNumBins> )

Parameters

int nDegree
The degree of the polynomial curve that you want to fit to the data. The value of nDegree must be a positive integer that does not exceed 30 and is less than the number of data points.

int nNumBins
The number of bins to use to partition the data. Calling this method without specifying the nNumBins parameter is equivalent to calling it with nNumBins equal to 50.

Remarks

This method computes a polynomial least-squares estimator to the data displayed in the ScatterPlot. The data is first partitioned into nNumBins uniformly spaced bins, and then a regression curve is fit to the average of the values in each bin.

Example
x = { 1 2 3 4 5 6 7 8 };
y = { 2 1 4 5 6 5 6 9 };
declare ScatterPlot plot;
plot = ScatterPlot.Create( "Sample Data", x, y );
plot.CreatePolyCurve( 1 );
See Also

ScatterPlot.CreateKernelCurve