kLocal: Uses cross validation to determine the k for kNN bandwidth...

Description Usage Arguments Value Examples

View source: R/bandwidth_selection.R

Description

Uses cross validation to determine the k for kNN bandwidth selection.

Usage

1
kLocal(data, test)

Arguments

data

The data matrix.

test

Vector of integers that shall be tested. Chooses the k that has the highest likelihood.

Value

Matrix with 4 columns, one for each pair of variables. The first two columns indicate the pair in question, the third column givs the selected k, and the last column returns a 1 if the selected k is an endpoint for the "test"-vector. Perhaps one should change the search area?

Examples

1
2
data <- cbind(rnorm(100), rnorm(100))
kLocal(data, test = seq(20, 80, 3))

hotneim/lgde documentation built on May 17, 2019, 4:52 p.m.