[R] Bandwidth selection for ksmooth( )
Prof Brian Ripley
ripley at stats.ox.ac.uk
Thu Dec 8 15:56:05 CET 2005
Please stop sending the same message over and over again (I see it 3 times
in the archive), using HTML mail which we specifically ask you not to in
the posting guide.
You are using a bandwidth selector for density() with ksmooth().
You seem still not to have read the help page for ksmooth, which says
Note:
This function is implemented purely for compatibility with S,
although it is nowhere near as slow as the S function. Better
kernel smoothers are available in other packages.
If you were using this for compatibility with S, you would know how to use
it. So do heed the advice, and not pester us for advice on how to use
something you are explicitly advised against using.
On Thu, 8 Dec 2005, Amir Safari wrote:
>
>
>
>
>
> Dear R Users,
> Before running ksmooth( ), a suitable bandwidth selection is needed. I use some functions for this task and receive these results for my data:
> width.SJ(y,nb=100,method="ste") : 40.25
> bcv(y,nb=100) : 40.53
> ucv(y) : 41.26
> bandwidth.nrd(y) : 45.43
> After implementing the function ksmooth(x,y, bandwidth= each of abovementioned bandwidths), I have some NAs in output with regard to each bandwidth. But if the bandwidth be equal to 62 or bigger, then the function ksmooth(x,y, bandwidth=62 or bigger) works without NA,i.e., the bandwidth must be at least 62 in order to not have NA in output.
> That was the first case. In second case, I have to choose bandwidth bigger than the number of observations in order to not have NA in output of the function of ksmooth().
> What is my mistake ?
> Thank you for any help.
> Amir Safari
>
>
>
>
> ---------------------------------
>
>
>
>
>
> ---------------------------------
>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>
--
Brian D. Ripley, ripley at 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
More information about the R-help
mailing list