Kernel density estimation (Epanechnikov weight function) [STB-16: snp6] -------------------------------------------------------- ^kernepa^ varname halfwidth density midpt Description ----------- ^kernepa^ estimates the density of "varname" using the Epanechnikov kernel as described in Fox, (1990). Following a suggestion of Chambers et. al., the density is estimated at 50 equally spaced points in the range of "varname". "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. "midpt" is a new variable that contains the midpoints of the 50 bins within which the density is calculated. The data set is assumed to be sorted in the order of "varname". The Epanechnikov kernel is maximally efficient: it minimizes the MISE (mean integrated squared error). Example ------- . ^kernepa infmorat 20 epakern midpt^ After some time (depending on the number of observations) the results are placed in the new variable ^epakern^. . ^list midpt epakern^ lists the values of the 50 midpoints and the estimated density at each point. . ^graph epakern midpt if _n<=50, c(s) s(o)^ displays a graph of the density estimate. 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^, ^kerngaus^, ^adgakern^, ^adgaker2^