As far as I understood, this mailing list is not intended for basic statistical 
teaching or for arguments. Your first question was

  > In particular I'd like to know: what bandwidth is used
   
  which can be answered simply with ?kde2d.
  Now your question is

  > I just wanted to know what does it mean : h defaults to normal reference 
bandwidth 
   
  very different from the first one.
  Again, the answer is ?kde2d. Given that it's not the first time you wrote to 
the list, you should know that a bibliographical reference like Venables, W. N. 
and Ripley, B. D. (2002) _Modern Applied Statistics with S._ Fourth edition.  
Springer, is given so the R-user can refer to an article or to a text boox more 
detailed than an 'help page' can be.
  Sometimes I have to walk to the library too.
  Unless the function is very complicated or, even worse, invisible, one might 
want to type the function itself without options, like
  > kde2d
#(or page(kde2d))
  function (x, y, h, n = 25, lims = c(range(x), range(y))) 
{
    nx <- length(x)
    if (length(y) != nx) 
        stop("data vectors must be the same length")
    gx <- seq(lims[1], lims[2], length = n)
    gy <- seq(lims[3], lims[4], length = n)
    if (missing(h))
        h <- c(bandwidth.nrd(x), bandwidth.nrd(y))
    h <- h/4
    ax <- outer(gx, x, "-")/h[1]
    ay <- outer(gy, y, "-")/h[2]
    z <- matrix(dnorm(ax), n, nx) %*% t(matrix(dnorm(ay), n, 
        nx))/(nx * h[1] * h[2])
    return(list(x = gx, y = gy, z = z))
}
   
  So, looking at
   if (missing(h))
        h <- c(bandwidth.nrd(x), bandwidth.nrd(y))
   
  I would check 'bandwidth.nrd' and there it is
  > bandwidth.nrd
function (x) 
{
    r <- quantile(x, c(0.25, 0.75))
    h <- (r[2] - r[1])/1.34
    4 * 1.06 * min(sqrt(var(x)), h) * length(x)^(-1/5)
}
  
Best regards,
Marco Geraci


Marta Colombo <[EMAIL PROTECTED]> wrote:
  I already knew how to read the help page: ?kde2d
It wasn't the first time I wrote to the list.
I just wanted to know what does it mean : h defaults to
normal reference bandwidth ?
Best regards

Marta Colombo



---------- Initial Header -----------

>From : "Marco Geraci" [EMAIL PROTECTED]
To : "Marta Colombo" [EMAIL PROTECTED]
Cc :
Date : Fri, 20 Jan 2006 10:25:22 -0800 (PST)
Subject : Re: [R] function kde2d







> http://www.R-project.org/posting-guide.html
> and
> ?kde2d
>
> Marta Colombo wrote:
> Good evening,
> I am Marta Colombo, student at Milan's Politecnico.
> Thank you very much for your kindness, this mailing list is really useful.
> I am using the function kde2d for two-dimensional kernel density estimation 
> and I'd like to know something more about this kind of density estimator. In 
> particular I'd like to know: what bandwidth is used ?
> Thank you in advance for your attention
>
> Marta Colombo
>
> ______________________________________________
> [email protected] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>
>
>
>
> ---------------------------------
> Yahoo! Autos. Looking for a sweet ride? Get pricing, reviews, & more on new 
> and used cars.

  


                
---------------------------------

 Photo Books. You design it and we’ll bind it!
        [[alternative HTML version deleted]]

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to