ovl_kde: Calculate distribution overlap by KDE

View source: R/kde.R

ovl_kdeR Documentation

Calculate distribution overlap by KDE

Description

Calculate distribution overlap by KDE (Kernel Density Estimation) This function compares two estimated distributions by KDE method. It utilizes base density function in R.

Usage

ovl_kde(x1, x2, n = 1024)

Arguments

x1

A numeric vector.

x2

A numeric vector.

n

An integer. Number of bins in KDE.

Value

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

Author(s)

Seongyong Park (2020-08-18)

References

This code is adopted from overlapping package (paper) and modified by Seongyong Park. You can find original implementation in overlapping R package. (github)

See Also

overlap

Examples

x1 = rnorm(100, 0)
x2 = rnorm(100, 1)
ovl_kde(x1, x2, n=1024)

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