The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.

Version: 1.1.1
Date: 2025-07-22
Title: Difference Measures for Multivariate Gaussian Probability Density Functions
Author: Henning Rust [aut, cre]
Maintainer: Henning Rust <henning.rust@met.fu-berlin.de>
Depends: R (≥ 1.8.0)
Description: A collection difference measures for multivariate Gaussian probability density functions, such as the Euclidea mean, the Mahalanobis distance, the Kullback-Leibler divergence, the J-Coefficient, the Minkowski L2-distance, the Chi-square divergence and the Hellinger Coefficient.
License: GPL-2 | GPL-3 [expanded from: GPL (≥ 2)]
URL: https://gitlab.met.fu-berlin.de/StatMet/gaussDiff
Packaged: 2025-07-22 08:36:43 UTC; felif21
Repository: CRAN
Date/Publication: 2025-07-22 10:51:56 UTC
NeedsCompilation: no

Difference measures for multivariate Gaussian pdfs

Description

Various difference measures for Gaussian pdfs are implemented: Euclidean distance of the means, Mahalanobis distance, Kullback-Leibler divergence, J-Coefficient, Minkowski L2-distance, Chi-square divergence and the Hellinger coefficient which is a similarity measure.

Usage

normdiff(mu1,sigma1=NULL,mu2,sigma2=sigma1,inv=FALSE,s=0.5,
method=c("Mahalanobis","KL","J","Chisq",
"Hellinger","L2","Euclidean"))

Arguments

mu1

mean value of pdf 1, a vector

sigma1

covariance matrix of pdf 1

mu2

mean value of pdf 2, a vector

sigma2

covariance matrix of pdf 2

method

difference measure to be used, see below

inv

if TRUE, 1-Hellinger is reported, default: inv=FALSE

s

exponent for Hellinger coefficient, default: s=0.5

Details

Equations can be found in H.-H. Bock, Analysis of Symbolic Data, Chapter Dissimilarity Measures for Probability Distributions

Value

A scalar object of class normdiff reporting the distance.

Author(s)

Henning Rust, henning.rust@met.fu-berlin.de

References

H.-H. Bock, Analysis of Symbolic Data, Chapter Dissimilarity measures for Probabilistic Distributions

Examples

library(gaussDiff)
mu1 <- c(0,0,0)
sig1 <- diag(c(1,1,1))
mu2 <- c(1,1,1)
sig2 <- diag(c(0.5,0.5,0.5))

## Euclidean distance
normdiff(mu1=mu1,mu2=mu2,method="Euclidean")

## Mahalanobis distance
normdiff(mu1=mu1,sigma1=sig1,mu2=mu2,method="Mahalanobis")

## Kullback-Leibler divergence
normdiff(mu1=mu1,sigma1=sig1,mu2=mu2,sigma2=sig2,method="KL")

## J-Coefficient
normdiff(mu1=mu1,sigma1=sig1,mu2=mu2,sigma2=sig2,method="J")

## Chi-sqr divergence
normdiff(mu1=mu1,sigma1=sig1,mu2=mu2,sigma2=sig2,method="Chisq")

## Minkowsi L2 distance
normdiff(mu1=mu1,sigma1=sig1,mu2=mu2,sigma2=sig2,method="L2")

## Hellinger coefficient
normdiff(mu1=mu1,sigma1=sig1,mu2=mu2,sigma2=sig2,method="Hellinger")

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.