Kullback.Leibler: Kullback Leibler

Description Usage Arguments Value References Examples

View source: R/Kullback.Leibler.R

Description

Calculates Kullback Leibler divergence for all pairs of the datasets.

Usage

1
2
	Kullback.Leibler(group.data, plot = TRUE, main="Kullback Leibler Divergences", 
		parallel = FALSE, cores = 3)

Arguments

group.data

A list where each element is a matrix of taxonomic counts(columns) for each sample(rows).

plot

When 'TRUE' a heatmap of the results will also be generated.

main

A string to be used as the plots title.

parallel

When this is 'TRUE' it allows for parallel calculation of the KL distances. Requires the package doParallel.

cores

The number of parallel processes to run if parallel is 'TRUE'.

Value

A matrix of Kullback Leibler divergence values and a heatmap if plot is TRUE.

References

Kotz S, Johnson N.L (1981) Encyclopedia Of Statistical Sciences

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
	data(saliva)
	data(throat)
	data(tonsils)
	
	### Combine the data sets into a single list
	group.data <- list(saliva, throat, tonsils)
	
	## Not run: 
		kl <- Kullback.Leibler(group.data)
		kl
	
## End(Not run)

Example output

Loading required package: dirmult

Attaching package: 'HMP'

The following object is masked from 'package:dirmult':

    weirMoM

           Data Set 1 Data Set 2 Data Set 3
Data Set 1     0.0000  355.38839  510.54204
Data Set 2   355.3884    0.00000   21.51607
Data Set 3   510.5420   21.51607    0.00000

HMP documentation built on Aug. 31, 2019, 5:05 p.m.