KLdiv.fused: Fused Kullback-Leibler divergence for sets of distributions

Description Usage Arguments Value Author(s) See Also Examples

View source: R/rags2ridgesFused.R

Description

Function calculating the Kullback-Leibler divergence between two sets of multivariate normal distributions. In other words, it calculates a weigthed mean of Kullback-Leibler divergences between multiple paired normal distributions.

Usage

1
KLdiv.fused(MtestList, MrefList, StestList, SrefList, ns, symmetric = FALSE)

Arguments

MtestList

A list of mean vectors of the approximating multivariate normal distribution for each class. Assumed to be zero vectors if not supplied.

MrefList

A list of mean vectors of the reference multivariate normal distribution for each class. Assumed to be zero vectors if not supplied.

StestList

A list of covariance matrices of the approximating multivariate normal distribtuion for each class. Usually a list of sample covariance matrices.

SrefList

A list of covariance matrices of the references multivariate normal distribtuion for each class. Usually a list of the population or reference covariance matrices.

ns

a numeric of the same length as the previous arguments giving the sample sizes. Used as weights in the weighted mean.

symmetric

a logical indicating if original symmetric version of KL divergence should be calculated.

Value

Function returns a numeric representing the (optionally symmetric) fused Kullback-Leibler divergence.

Author(s)

Anders Ellern Bilgrau, Wessel N. van Wieringen, Carel F.W. Peeters <[email protected]>

See Also

KLdiv

Examples

1
2
3
4
5
6
7
8
# Create some toy data
n <- c(40, 60, 80)
p <- 10
Stest <- replicate(length(n), diag(p), simplify = FALSE)
Sref <- createS(n, p = p)

KLdiv.fused(StestList = Stest, SrefList = Sref, ns = n, symmetric = FALSE)
KLdiv.fused(StestList = Stest, SrefList = Sref, ns = n, symmetric = TRUE)

CFWP/rags2ridges documentation built on Sept. 23, 2017, 6:38 a.m.