Skip to content

Wrong constants in sj function (sm library) (PR#2467)

2 messages · jechacon@unex.es, Brian Ripley

#
Full_Name: J. E. Chacón
Version: 1.6.2
OS: Windows Millenium
Submission from: (NULL) (158.49.28.155)


Dear reader,
   I am studying the bandwidth selection problem for density estimation. I have
read the popular Sheather & Jones (1991) article, in which this sj function is
based, to obtain (through function hsj) the bandwidth selector which appears in
that article. The problem is that the constants appearing in Sheather & Jones
paper are wrong, and this same (wrong) constants are used in the implementation
of the method for R. The (wrong) values are a=0.92*IQR*n^(-1/7) and
b=0.912*IQR*n^(-1/9). The constants there are wrong, the correct ones are:
- For a, (16*sqrt(2)/5)^(1/7)=~1.24   and
- For b, (32*sqrt(2)/7)^(1/9)=~1.23
These corrected values appear, for instance, in the function width.SJ of MASS
library.
I hope this helps for improving this wonderful sm library.
Yours sincerely,
    J.E. Chacón
P.S.: Greetings from here for Professor Azzalini, who I met at his Smoothing
Methods course in Girona (Spain), last November, 2001.
#
Bugs in packages are better sent to the maintainer than to R-bugs, as 
package maintainers do not in general have access to R-bugs.

This seems to me not to be a bug at all: the method has been correctly
implemented.  That the method is less then perfect is something you need 
to take up with the *authors* -- it would be wrong for me to change their 
code (especially since R itself has the Sheather-Jones method implemented, 
as well as MASS).  If they want to change their S code the changes will 
percolate through to the R port eventually, but they may prefer to use the 
method they (I presume) give in their book.
On Thu, 16 Jan 2003 jechacon@unex.es wrote: