HellingerDist {distrEx} | R Documentation |
Generic function for the computation of the Hellinger distance d_h of two distributions P and Q which may be defined for an arbitrary sample space (Omega, A). The Hellinger distance is defined as
0.5 int |sqrt{dP}-sqrt{dQ}|^2
where sqrt{dP}, respectively sqrt{dQ} denotes the square root of the densities.
HellingerDist(e1, e2, ...) ## S4 method for signature 'AbscontDistribution, ## AbscontDistribution': HellingerDist(e1,e2) ## S4 method for signature 'AbscontDistribution, ## DiscreteDistribution': HellingerDist(e1,e2) ## S4 method for signature 'DiscreteDistribution, ## AbscontDistribution': HellingerDist(e1,e2) ## S4 method for signature 'DiscreteDistribution, ## DiscreteDistribution': HellingerDist(e1,e2) ## S4 method for signature 'numeric, DiscreteDistribution': HellingerDist(e1, e2) ## S4 method for signature 'DiscreteDistribution, numeric': HellingerDist(e1, e2) ## S4 method for signature 'numeric, AbscontDistribution': HellingerDist(e1, e2, asis.smooth.discretize = "discretize", n.discr = getdistrExOption("nDiscretize"), low.discr = getLow(e2), up.discr = getUp(e2), h.smooth = getdistrExOption("hSmooth")) ## S4 method for signature 'AbscontDistribution, numeric': HellingerDist(e1, e2, asis.smooth.discretize = "discretize", n.discr = getdistrExOption("nDiscretize"), low.discr = getLow(e1), up.discr = getUp(e1), h.smooth = getdistrExOption("hSmooth")) ## S4 method for signature 'AcDcLcDistribution, ## AcDcLcDistribution': HellingerDist(e1,e2)
e1 |
object of class "Distribution" or class "numeric" |
e2 |
object of class "Distribution" or class "numeric" |
asis.smooth.discretize |
possible methods are "asis" ,
"smooth" and "discretize" . Default is "discretize" . |
n.discr |
if asis.smooth.discretize is equal to
"discretize" one has to specify the number of lattice points
used to discretize the abs. cont. distribution. |
low.discr |
if asis.smooth.discretize is equal to
"discretize" one has to specify the lower end point of the lattice
used to discretize the abs. cont. distribution. |
up.discr |
if asis.smooth.discretize is equal to
"discretize" one has to specify the upper end point of the lattice
used to discretize the abs. cont. distribution. |
h.smooth |
if asis.smooth.discretize is equal to
"smooth" – i.e., the empirical distribution of the provided
data should be smoothed – one has to specify this parameter. |
... |
further arguments to be used in particular methods (not in package distrEx) |
In case we want to compute the Hellinger distance between (empirical) data
and an abs. cont. distribution, we can specify the parameter asis.smooth.discretize
to avoid trivial distances (distance = 1).
Using asis.smooth.discretize = "discretize"
, which is the default,
leads to a discretization of the provided abs. cont. distribution and
the distance is computed between the provided data and the discretized
distribution.
Using asis.smooth.discretize = "smooth"
causes smoothing of the
empirical distribution of the provided data. This is, the empirical
data is convoluted with the normal distribution Norm(mean = 0, sd = h.smooth)
which leads to an abs. cont. distribution. Afterwards the distance
between the smoothed empirical distribution and the provided abs. cont.
distribution is computed.
Hellinger distance of e1
and e2
distrExintegrate
.
=1
).
support
and sum
.
=1
).
Matthias Kohl Matthias.Kohl@stamats.de,
Peter Ruckdeschel Peter.Ruckdeschel@itwm.fraunhofer.de
Huber, P.J. (1981) Robust Statistics. New York: Wiley.
Rieder, H. (1994) Robust Asymptotic Statistics. New York: Springer.
distrExIntegrate
, ContaminationSize
,
TotalVarDist
, KolmogorovDist
,
Distribution-class
HellingerDist(Norm(), Gumbel()) HellingerDist(Norm(), Td(10)) HellingerDist(Norm(mean = 50, sd = sqrt(25)), Binom(size = 100)) # mutually singular HellingerDist(Pois(10), Binom(size = 20)) x <- rnorm(100) HellingerDist(Norm(), x) HellingerDist(x, Norm(), asis.smooth.discretize = "smooth") y <- (rbinom(50, size = 20, prob = 0.5)-10)/sqrt(5) HellingerDist(y, Norm()) HellingerDist(y, Norm(), asis.smooth.discretize = "smooth") HellingerDist(rbinom(50, size = 20, prob = 0.5), Binom(size = 20, prob = 0.5))