KLdist.matrix: Discrete version of Kullback-Leibler Distance (KLD)

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Calculate the KLD by binning continuous data.

KL distance is calculated using the formula

KLD(f_1(x),f_2(x)) = ∑_{i=1}^N{ f_1(x_i)*\log\frac{f_1(x_i)}{f_2(x_i)}}

Usage

1

Arguments

x

n by p matrix or a list or an object of a class that extends eSet. If x is an object of a class derived from eSet (ExpressionSet,SnpSet etc), then the values returned by the exprs function are used.

...

arguments passed to KLdist.matrix:

gridsize

the number of grid points used to select the optimal bin width of the histogram used to estimate density. If no value is supplied, the grid size is calculated internally; default is NULL.

symmetrize

if TRUE, then symmetrize; the default is FALSE.

diag

if TRUE, then the diagonal of the distance matrix will be displayed; the default is FALSE.

upper

if TRUE, then the upper triangle of the distance matrix will be displayed; default is FALSE.

sample

for eSet methods: if TRUE, then the distances are computed between samples, otherwise, between features; the default is TRUE.

Details

The data are binned, and then the KL distance between the two discrete distributions is computed and used. The distance is computed between rows of the input matrix (except if the input is an object of a class that extends eSet and sample is TRUE.

The presumption is that all samples have the same number of observations. The list method is meant for use when samples sizes are unequal.

Value

An object of class dist is returned.

Author(s)

Beiying Ding

See Also

cor.dist, spearman.dist, tau.dist,euc, man,KLD.matrix,mutualInfo

Examples

1
2
 x <- matrix(rnorm(100), nrow = 5)
 KLdist.matrix(x, symmetrize = TRUE) 

Example output

Loading required package: Biobase
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

    IQR, mad, sd, var, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, cbind, colMeans, colSums, colnames, do.call,
    duplicated, eval, evalq, get, grep, grepl, intersect, is.unsorted,
    lapply, lengths, mapply, match, mget, order, paste, pmax, pmax.int,
    pmin, pmin.int, rank, rbind, rowMeans, rowSums, rownames, sapply,
    setdiff, sort, table, tapply, union, unique, unsplit, which,
    which.max, which.min

Welcome to Bioconductor

    Vignettes contain introductory material; view with
    'browseVignettes()'. To cite Bioconductor, see
    'citation("Biobase")', and for packages 'citation("pkgname")'.

Loading required package: KernSmooth
KernSmooth 2.23 loaded
Copyright M. P. Wand 1997-2009
          1         2         3         4
2 5.9919159                              
3 3.4899114 0.9365696                    
4 2.2514987 0.7356014 1.2848732          
5 2.5332660 1.1916893 0.9661362 1.3517168

bioDist documentation built on Nov. 8, 2020, 5:14 p.m.