Let me refer to the manual with regard to bivariate bandwidth selection:
For the bivariate case, Wand and Jones (1993) note that automatic bandwidth selection is both difficult and computationally expensive. Their study of various ways of specifying a bandwidth matrix also shows that using two bandwidths, one in each coordinate’s direction, is often adequate. PROC KDE enables you to adjust the two bandwidths by specifying a multiplier for the default bandwidths recommended by Bowman and Foster (1993😞
Here and are the sample standard deviations of X and Y, respectively. These are the optimal bandwidths for two independent normal variables that have the same variances as X and Y. They are, therefore, conservative in the sense that they tend to oversmooth the surface.
The bandwidth calculation due to Bowman and Foster is performed internally by PROC KDE, and the initial bandwidths are set accordingly.
You can specify the BWM= option to adjust the aforementioned bandwidths to provide the appropriate amount of smoothing for your application.
The final bandwidth used for computing the KDE is the initial bandwidth times BWM. If you want more smoothing than the default, set BWM > 1.0. If you want less smoothing than the default, set BMW < 1.0.
Your IML code
* calculate bwm plug-in;
proc iml;
use data;
read all var {X Y FREQ} into xy;
n=sum(xy[,3]);
stdx=std(xy[,1])/(n**(1/6));
call symput("stdxg", char(stdx));
stdy=std(xy[,2])/(n**(1/6));
call symput("stdyg", char(stdy));
quit;
duplicates the internal initial bandwidth calculation. When you set BWM to &stdxg and &stdyg in
proc kde data=data;
bivar (X (bwm=&stdxg ngrid=&gridsize gridl=&minX gridu=&maxX )
Y (bwm=&stdyg ngrid=&gridsize gridl=&minY gridu=&maxY )) / plots=all;
freq FREQ;
run;
the final bandwidth used to calculate the KDE is the variance in each dimension rather than the standard deviation. Is this what you want?
... View more