KLsym: Symmetric Kullback-Leibler divergence between samples drawn...

Description Usage Arguments Value Examples

Description

This function calculates the symmetric Kullback-Leibler divergence between two empirical distriburions.

Usage

1
KLsym(x1, x2)

Arguments

x1

a matrix, where each row corresponds to draws from a random distribution

x2

a matrix, where each row corresponds to draws from a random distribution and should have the same number of rows as x1

Value

A vector with the length equal to the number of rows of input matrices,

Examples

1
2
3
4
5
6
7
x1 <- matrix(0, 2, 100)
x1[1,] <- rnorm(100, 0, 1)
x1[2,] <- rnorm(100, -1, 2)
x2 <- matrix(0, 2, 100)
x2[1,] <- rnorm(100, 1, 0)
x2[1,] <- rnorm(100, 1, 3)
kl <- KLsym(x1, x2)

siamakz/BNPseq documentation built on May 15, 2019, 4:28 p.m.