[R] Triangular distribution for kernel regression

Gabor Grothendieck ggrothendieck at gmail.com
Sun Sep 13 19:55:47 CEST 2009


If by chance you have an objective function you could automatically
calculate the optimum number of nearest neighbors by cross validation
eliminating the need to set it in the first place.

On Sun, Sep 13, 2009 at 10:19 AM, Bryan <thespamhouse at gmail.com> wrote:
> Is this option (number of nearest neighbors) translate-able into bandwidth?
> In reading the kknn article, it seems like it might be but I'm still not
> exactly sure how. Unfortunately this is an important issue as the end users
> are used to using certain bandwidth values for their work.
>
> It may be more efficient to ask, more generally, how would I reproduce this
> command:
>
> ksmooth(x, y, "normal", bandwidth=10)
>
> where x and y are ratio level variables, using kknn?
>
> Thanks for your patience and continued assistance.
>
>
> On Sat, Sep 12, 2009 at 5:19 PM, Gabor Grothendieck
> <ggrothendieck at gmail.com> wrote:
>>
>> You can specify the number of nearest neighbors.
>>
>> On Sat, Sep 12, 2009 at 5:16 PM, Bryan <thespamhouse at gmail.com> wrote:
>> > I originally looked over kknn because I need to be able to specify a
>> > bandwidth parameter.  I am trying to replicate some previous non-R work
>> > in
>> > R, so I can't stray to far from the procedure used there.  In reading
>> > the
>> > paper referenced in the docs, I see that kknn can reduce to the
>> > Nadaraya–Watson estimator, which is where I need to be, but I'm not sure
>> > how
>> > to manipulate the bandwidth, as would be possible in other methods.  Can
>> > you
>> > clarify this at all?
>> >
>> > Bryan
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> > On Sat, Sep 12, 2009 at 3:46 PM, Gabor Grothendieck
>> > <ggrothendieck at gmail.com> wrote:
>> >>
>> >> What about kknn -- that was listed as having the triangular
>> >> distribution?
>> >>
>> >>
>> >> On Sat, Sep 12, 2009 at 3:42 PM, Bryan <thespamhouse at gmail.com> wrote:
>> >> > Gabor,
>> >> >
>> >> > Thanks for your quick reply (on a weekend even!)  I've looked through
>> >> > the
>> >> > results of the search you recommended, and several related searches,
>> >> > and
>> >> > don't see anything exceptionally helpful.  Kernel regression is a
>> >> > relatively
>> >> > new analysis for me; I apologize for needing a little more direction.
>> >> >
>> >> > I've understand that it is connected to local polynomial regression
>> >> > but
>> >> > I
>> >> > can't seem to have any success from that direction either. At this
>> >> > point
>> >> > the
>> >> > only package that is giving smoothed estimates as I would expect is
>> >> > ksmooth
>> >> > - which doesn't include the appropriate distribution.
>> >> >
>> >> > Best,
>> >> > Bryan
>> >> >
>> >> >
>> >> > On Sat, Sep 12, 2009 at 1:55 PM, Gabor Grothendieck
>> >> > <ggrothendieck at gmail.com> wrote:
>> >> >>
>> >> >> Try:
>> >> >>
>> >> >> RSiteSearch("kernel triangular")
>> >> >>
>> >> >> On Sat, Sep 12, 2009 at 1:51 PM, Bryan <thespamhouse at gmail.com>
>> >> >> wrote:
>> >> >> > Hello,
>> >> >> >
>> >> >> > I am trying to get fitted/estimated values using kernel regression
>> >> >> > and a
>> >> >> > triangular kernel.  I have found packages that easily fit values
>> >> >> > from
>> >> >> > a
>> >> >> > kernel regression (e.g. ksmooth) but do not have a triangular
>> >> >> > distribution
>> >> >> > option, and density estimators that have triangular distribution
>> >> >> > options
>> >> >> > that I can't seem to use to produce estimated values (e.g.
>> >> >> > density).
>> >> >> >  Any
>> >> >> > help is appreciated.
>> >> >> >
>> >> >> > Bryan
>> >> >> >
>> >> >> >        [[alternative HTML version deleted]]
>> >> >> >
>> >> >> > ______________________________________________
>> >> >> > R-help at r-project.org mailing list
>> >> >> > https://stat.ethz.ch/mailman/listinfo/r-help
>> >> >> > PLEASE do read the posting guide
>> >> >> > http://www.R-project.org/posting-guide.html
>> >> >> > and provide commented, minimal, self-contained, reproducible code.
>> >> >> >
>> >> >
>> >> >
>> >
>> >
>
>




More information about the R-help mailing list