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

hellinger

Hellinger distance


Description

Estimate the Hellinger distance between two random samples whose underdyling distributions are continuous.

Usage

hellinger(x, y, lower = -Inf, upper = Inf, method = 1, ...)

Arguments

x

numeric. A vector giving the first sample.

y

numeric. A vector giving the second sample.

lower

numeric. Lower limit passed to integrate.

upper

numeric. Upper limit passed to integrate.

method

integer. If method = 1, the usual definition of the Hellinger distance is used; if method = 2, an alternative formula is used.

...

Additional parameters to be passed to densityfun.

Details

Probability density functions are estimated with densityfun. Then numeric integration is performed with integrate.

Value

A numeric value, the Hellinger distance.

References

See Also

HellingerDist in package distrEx.

Examples

x <- rnorm(200, 0, 2)
y <- rnorm(1000, 10, 15)
hellinger(x, y, -Inf, Inf)
hellinger(x, y, -Inf, Inf, method = 2)

statip

Statistical Functions for Probability Distributions and Regression

v0.2.3
GPL-3
Authors
Paul Poncet [aut, cre], The R Core Team [aut, cph] (C function 'BinDist' copied from package 'stats'), The R Foundation [cph] (C function 'BinDist' copied from package 'stats'), Adrian Baddeley [ctb] (C function 'BinDist' copied from package 'stats')
Initial release

We don't support your browser anymore

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