hellinger: Estimate the Hellinger distance between two random variates

Description Usage Arguments Details Value Author(s)

View source: R/hellinger.R

Description

Estimate the Hellinger distance between two random variates

Usage

1
2
hellinger(x1, x2, nbreaks = 100, minx = min(c(x1, x2)),
maxx = max(c(x1, x2)))

Arguments

x1

A numeric random variate of draws from the first distribution

x2

A numeric random variate of draws from the second distribution

nbreaks

A single numeric giving how many breaks to break the discrete distribution into

minx

A single numeric giving the lower bound of integration

maxx

A single numeric giving the upper bound of integration

Details

Hellinger distance is approximated in two ways:

(1) by binning the random variates and calculating the Hellinger distance for discrete distributions and

(2) by creating a continuous approximation of the distributions using density and then using numerical integration to calculate the Hellinger distance.

Method (2) - continuous integration - should in genernal be more accurate however, it may give poor approximations for multi-modal distributions.

Continuous integration may return NaN if the distributions are near identical. Class helldist has a plot method that can be used to compared the discrete and continuous distribution fits.

It is recommended to visually check distribution fits, particularly if the number of random variates is small.

In general these methods will be inaccurate if analysis is performed on too few samples, e.g. <10 000. >100 000 would be ideal.

Value

A helldist object containing approximate Hellinger distances and fitted density kernals.

hdist_disc

Estimate of Hellinger distance using discrete approximation of the distributions

hdist_cont

Estimate of Hellinger distance using continous approximation of distributions

Author(s)

Christopher J. Brown christo.j.brown@gmail.com


cbrown5/BayeSens documentation built on April 26, 2020, 12:40 a.m.