[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

From |
"Nick Cox" <n.j.cox@durham.ac.uk> |

To |
<statalist@hsphsun2.harvard.edu> |

Subject |
RE: st: optimal bandwidth in Stata 8 |

Date |
Mon, 15 Sep 2008 18:21:09 +0100 |

I agree with Austin. Indeed I would underline his argument with further points. First, bandwidth means different things w.r.t. different kernels because the parameter for each that tunes bandwidth does not have the same effect, as the kernels are defined quite differently, a point that is at least tacit in the official documentation. Second, -kernreg- and -kernreg1- are both buggy; -kernreg2- is I believe better. Use -findit- for locations. But unless you are using some ancient Stata there is no reason whatsoever to use any rather than -lpoly- or some other similar method implemented as an official command. I no longer have access to Stata 8 but I believe the same point applies there too. Third, -kernreg- and -kernreg1- and -kernreg2- are not density estimation command. Nick n.j.cox@durham.ac.uk Austin Nichols Benjamin Villena Roldan <bvillena@troi.cc.rochester.edu> : The Methods and Formulas section of the manual entry [R] kdensity is quite clear: the default bandwidth is .9*N^(-1/5)*min(sd(x), IQR(x)/1.349) which is not globally optimal in any sense. The Methods and Formulas section of the manual entry [R] lpoly shows the formula for the "asymptotically optimal constant bandwidth" used there (also not globally optimal). You mention kernreg and kernreg1 which are not official Stata, so you would have to read their help files, read the ado code, or contact their authors for more detail. The -locpoly- command on SSC enjoys a special status; it is not official Stata but is written by Stata staff (way before -lpoly- was introduced). If you view "http://www.stata-journal.com/software/sj6-4/st0053_3/locpoly.hlp"; in Stata, you will find the hilarious throwaway line: If width() is not specified, then the "default" width is used; see [R] kdensity. This default is entirely inappropriate for local polynomial smoothing. Roll your own. On Mon, Sep 15, 2008 at 12:01 PM, Benjamin Villena Roldan <bvillena@troi.cc.rochester.edu> wrote: > I'm running some kernel density estimation in Stata 8. > The help file asserts that the "optimal" width is used (bandwidth) to do the > kernel estimation. I searched in the internet, but I haven't found a clear > description of the procedure used. Does anyone know the precise meaning of > "optimal" width? (Cross-validation perhaps?). > Does anyone know if the same choice is used for kernreg and kernreg1? * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

**Follow-Ups**:**RE: st: optimal bandwidth in Stata 8***From:*"Benjamin Villena Roldan" <bvillena@troi.cc.rochester.edu>

**References**:**st: control function with STATA***From:*"Nirina F" <fstata@gmail.com>

**Re: st: control function with STATA***From:*"Austin Nichols" <austinnichols@gmail.com>

**st: optimal bandwidth in Stata 8***From:*"Benjamin Villena Roldan" <bvillena@troi.cc.rochester.edu>

**Re: st: optimal bandwidth in Stata 8***From:*"Austin Nichols" <austinnichols@gmail.com>

- Prev by Date:
**st: RE: suggestion for missing()** - Next by Date:
**RE: st: optimal bandwidth in Stata 8** - Previous by thread:
**Re: st: optimal bandwidth in Stata 8** - Next by thread:
**RE: st: optimal bandwidth in Stata 8** - Index(es):

© Copyright 1996–2016 StataCorp LP | Terms of use | Privacy | Contact us | What's new | Site index |