Skip to content
Back to formatted view

Raw Message

Message-ID: <20120729184427.GB20999@cs.cas.cz>
Date: 2012-07-29T18:44:27Z
From: Petr Savicky
Subject: Nearest Neighbors
In-Reply-To: <1343147209271-4637618.post@n4.nabble.com>

On Tue, Jul 24, 2012 at 09:26:49AM -0700, olemissrebs1123 wrote:
> I was wondering if there is a way in R to find k nearest neighbors of various
> orders, say order 2, 3, or 4. In otherwords neighbors of neighbors of
> neighbors. You get the idea. I know that I can use knearneigh(matrix.data,
> k) but this only gives me the k nearest neighbors and not of a particular
> order. 

Hi.

If i understand correctly, then this may be achieved by several iterations.
In the first iteration, the nearest neighbours are found. The next iteration
starts from them a finds their nearest neighbours. These are neighbours of
order 2. A general iteration finds neighbours of order n by looking for neighbours
of the points found in the previous step, which are the neighours of order n-1.

Hope this helps.

Petr Savicky.