Skip to content

Kernel smoothing density function

4 messages · Ferra Xu, Sarah Goslee

#
Hi,
On Thu, Jul 24, 2014 at 1:22 PM, Ferra Xu <ferra.xu at yahoo.com> wrote:
See why you shouldn't post HTML to this list?

Trying to parse that, I see that I can't run your example because no
data are provided (dput() is a good function to know).

When I run the example code given in ?kde it works as expected. Does
your plot command create a plot on other devices, like the default for
your OS? Does the example code in ?kde work when you run it? Does it
create a plot?

As for the estimated values, did you carefully read the Value section
of the help file?

     A kernel density estimate is an object of class ?kde? which is a
     list with fields:

       x: data points - same as input

eval.points: points at which the estimate is evaluated

estimate: density estimate at ?eval.points?

If this density estimate is not the estimate you are looking for,
you'll need to be more specific.

Sarah
#
Dear Sarah
Thank you for your response. I have attached the data that I'm using. I noticed that no estimate and eval.points are generated...Would you please take a look at it??
It creates a plot in R environment but the pdf file doesn't work.

Appreciate your help,
On Thursday, July 24, 2014 12:35 PM, Sarah Goslee <sarah.goslee at gmail.com> wrote:
Hi,
On Thu, Jul 24, 2014 at 1:22 PM, Ferra Xu <ferra.xu at yahoo.com> wrote:
See why you shouldn't post HTML to this list?

Trying to parse that, I see that I can't run your example because no
data are provided (dput() is a good function to know).

When I run the example code given in ?kde it works as expected. Does
your plot command create a plot on other devices, like the default for
your OS? Does the example code in ?kde work when you run it? Does it
create a plot?

As for the estimated values, did you carefully read the Value section
of the help file?

? ?  A kernel density estimate is an object of class ?kde? which is a
? ?  list with fields:

? ? ?  x: data points - same as input

eval.points: points at which the estimate is evaluated

estimate: density estimate at ?eval.points?

If this density estimate is not the estimate you are looking for,
you'll need to be more specific.

Sarah
#
On Thu, Jul 24, 2014 at 4:06 PM, Ferra Xu <ferra.xu at yahoo.com> wrote:
Of course the estimate is generated, just as the help file promised.

hat$estimate

contains the estimate: all the named components given in the Value
section of the helpfile
are part of hat, and you can see that with
names(hat)

Have you read the Introduction to R that comes with your R
installation? Perhaps you should.
Well, ?plot.kde states that for 3D data it produces an interactive RGL
plot, and unlike for 1D and 2D there are no other options.

What do you expect to be printed to PDF when you create an interactive plot?

Reading ?rgl suggests that you might want to look into ?rgl.snapshot

Sarah