From ripley@stats.ox.ac.uk  Thu Jan 16 18:23:03 2003
From: ripley@stats.ox.ac.uk (ripley@stats.ox.ac.uk)
Date: Thu Jan 16 18:23:03 2003
Subject: [Rd] Wrong constants in sj function (sm library) (PR#2467)
In-Reply-To: <200301161704.SAA14084@pubhealth.ku.dk>
Message-ID: <Pine.LNX.4.44.0301161716310.1209-100000@gannet.stats>

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:

> Full_Name: J. E. Chacn
> 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. Chacn
> P.S.: Greetings from here for Professor Azzalini, who I met at his Smoothing
> Methods course in Girona (Spain), last November, 2001.
> 
> ______________________________________________
> R-devel@stat.math.ethz.ch mailing list
> http://www.stat.math.ethz.ch/mailman/listinfo/r-devel
> 

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



[Rd] Wrong constants in sj function (sm library) (PR#2467)
ripley@stats.ox.ac.uk