ScatterPlot.CreateKernelCurve

Prototypes

void CreateKernelCurve( int nEstimator, int nKernel, double dBandwidth <, int nNumBins> )

Parameters

int nEstimator
The kernel estimator that you want to fit to the data. The choices are ESTIMATOR_EVALUATION and ESTIMATOR_CONVOLUTION.

int nKernel
The shape of the kernel to use in the kernel estimator. The choices are KERNEL_UNIFORM, KERNEL_TRIANGULAR, KERNEL_QUADRATIC, KERNEL_BIWEIGHT, KERNEL_TRIWEIGHT, and KERNEL_NORMAL.

double dBandwidth
The bandwidth (or smoothing parameter) to use to scale the kernel function in the kernel estimator. The value of dBandwidth must be greater than zero and greater than the minimum allowed bandwidth. Alternatively, you can specify that you want the bandwidth computed automatically. The choices for automatic bandwidth selection are BANDWIDTH_AIC, BANDWIDTH_CAIC, BANDWIDTH_GCV, and BANDWIDTH_RICET.

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 nonparametric kernel estimator to the data displayed in the ScatterPlot. The data is first partitioned into nNumBins uniformly spaced bins, and then kernel estimation is used to fit a curve to the average of the values in each bin. For the details of the computation, see Kernel Estimators.

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.CreateKernelCurve( ESTIMATOR_EVALUATION,
                        KERNEL_BIWEIGHT,
                        2.5 );
See Also

ScatterPlot.CreatePolyCurve