ovl_knn: Calculate distribution overlap by KNN

View source: R/knn.R

ovl_knnR Documentation

Calculate distribution overlap by KNN

Description

Calculate distribution overlap by KNN (K-Nearest neighbor) This function compares label of K-nearest neighbors and calculate how many labels are mismatch.

Usage

ovl_knn(x1, x2, k = 5)

Arguments

x1

A numeric vector.

x2

A numeric vector.

k

An integer. Number of k in KNN

Value

estimated overlap between two distributions (range: 0 to 1)

Author(s)

Seongyong Park (2020-08-18)

References

This code is adopted from AmRMR (paper) and modified by Seongyong Park. You can find their implementation in their websites. (Java, R) Many thanks to the professor Sejong Oh (Dankook University, sejongoh@dankook.ac.kr) who kindly share his work.

Examples

x1 = rnorm(100, 0)
x2 = rnorm(100, 1)
ovl_knn(x1, x2, k=5)

psychemistz/ovltools documentation built on April 1, 2022, 2:26 a.m.