Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

calc_k

Calculation of the optimal number of neighbours.


Description

Calculates of optimal number of neighbours by using the algorithm proposed by Kayo (see Ref.). Therefore the LLE alorithm is performed for every k-neighbourhood size.

Usage

calc_k(X, m, kmin=1, kmax=20, plotres=TRUE, 
                  parallel=FALSE, cpus=2, iLLE=FALSE)

Arguments

X

matrix object containing the input data.

m

intrinsic dimension of the data.

kmin

minimal value of k.

kmax

maximal value of k.

plotres

a logical values indicating wheather to plot the result.

parallel

a logical values indicating wheather to use parallel computation on multiple cpu cores. See snowfall.

cpus

number of cpus cores used for parallel computation.

iLLE

a logical values indicating wheater to use improved LLE (very CPU intensive). See lle.

Details

Since the calculation of the optimal number of neighbours m is a step that is normally applied before the execution of LLE itself, the intrinsic dimension may be unknown. In this case, a good guess is sufficient. If no good estimation can be made the largest plausible value should be chosen.

Value

res

dataframe containing the number of neighbours and the calculated parameter ρ. The number of neighbours belonging to the smallest value of ρ should be chosen.

References

Locally linear embedding algorithm - extensions and applications / Olga Kayo / Universitatis Ouluensis, Oulu, Finland / 2006

Examples

## Not run: 
	data( lle_scurve_data )
	X <- lle_scurve_data
	calc_k( X, 2, 1, 15 ) 

	data( lle_scurve_data )
	X <- lle_scurve_data
	calc_k( X, 2, 1, 15, FALSE, TRUE, 4 ) 
   
## End(Not run)

lle

Locally linear embedding

v1.1
GPL-3
Authors
Holger Diedrich, Dr. Markus Abel (Department of Physics, University Potsdam)
Initial release
2012-03-21

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.