jeffreys function

Jeffreys measure between Gaussian densities

Jeffreys measure between Gaussian densities

Jeffreys measure (or symmetrised Kullback-Leibler divergence) between two multivariate (p>1p > 1) or univariate (p=1p = 1) Gaussian densities given samples (see Details).

jeffreys(x1, x2, check = FALSE)

Arguments

  • x1: a matrix or data frame of n1n1 rows (observations) and pp columns (variables) (can also be a tibble) or a vector of length n1n1.
  • x2: matrix or data frame (or tibble) of n2n2 rows and pp columns or vector of length n2n2.
  • check: logical. When TRUE (the default is FALSE) the function checks if the covariance matrices are not degenerate (multivariate case) or if the variances are not zero (univariate case).

Details

The Jeffreys measure between the two Gaussian densities is computed by using the jeffreyspar function and the density parameters estimated from samples.

Returns

Returns the Jeffrey's measure between the two probability densities.

Be careful! If check = FALSE and one smoothing bandwidth matrix is degenerate, the result returned must not be considered.

References

Thabane, L., Safiul Haq, M. (1999). On Bayesian selection of the best population using the Kullback-Leibler divergence measure. Statistica Neerlandica, 53(3): 342-360.

Author(s)

Rachid Boumaza, Pierre Santagostini, Smail Yousfi, Gilles Hunault, Sabine Demotes-Mainard

See Also

jeffreyspar : Jeffreys measure between Gaussian densities, given their parameters.

Examples

require(MASS) m1 <- c(0,0) v1 <- matrix(c(1,0,0,1),ncol = 2) m2 <- c(0,1) v2 <- matrix(c(4,1,1,9),ncol = 2) x1 <- mvrnorm(n = 3,mu = m1,Sigma = v1) x2 <- mvrnorm(n = 5, mu = m2, Sigma = v2) jeffreys(x1, x2)
  • Maintainer: Pierre Santagostini
  • License: GPL (>= 2)
  • Last published: 2024-11-22