Adaptive Gaussian kernel density estimation [STB-16: snp6] ------------------------------------------- ^adgakern^ varname halfwidth density Description ----------- ^adgakern^ estimates the density of "varname" using the adaptive Gaussian kernel described in Fox (1990) modified from Silverman (1986). "halfwidth" is a constant that specifies the width of the density window around each point. "density" is a new variable that contains the density estimate on output. ^adgakern^ estimates densities using a Gaussian kernel with fixed window, then uses these estimates to determine local weights inversely proportional to the preliminary density estimate. These local weights are used to adjust the window width so that it is narrower at high densities (retaining detail) and wider where density is low (eliminating noise). As with the fixed window kernels the "smoothness" of the result can be regulated by changing the width of the interval (i.e. varying 'h'). Wide intervals produce smooth results; narrow intervals will result in noiser density values. WARNING: Because this implementation requires the calculation of local weights for each individual observation based on a preliminary density estimation, the time required is proportional to 2*_N. Please be patient. Example ------- . ^adgakern infmorat 20 adensity^ After some time (depending on the number of observations) the results are placed in the new variable ^adensity^. . ^list infmorat adensity^ the values of the original variable and their corresponding estimated density appear on screen. . ^graph adensity infmorat, xlab ylab c(s) s(.)^ The graphic with the density estimates for each original value ("smoothed" histogram) will appear on screen. You can combine this with the oneway and box options. References ---------- Chambers, J.M., W.S. Cleveland, B. Kleiner and P.A. Tukey (1983) Graphical Methods for Data Analysis. Wadsworth & Brooks/Cole Chap. 2: 9-46. Silverman, B.W. (1986) Density Estimation for Statistics and Data Analysis. Chapman and Hall. Fox, J. (1990) Describing univariate distributions. In (Fox, J. & J.S. Long, Eds.) "Modern Methods of Data Analysis". Sage Chap. 2: 58-125. Authors ------- Isaias H. Salgado-Ugarte, Makoto Shimizu and Toru Taniuchi University of Tokyo, Faculty of Agriculture, Dept. of Fisheries (Fax 81-3-3812-0529) Also see -------- STB: snp6 (STB-16) On-line: ^help^ for ^boxdetra^, ^boxdetr2^, ^cosdetra^, ^kernsim^, ^kernepa^, ^kerngaus^, ^adgaker2^