KLspectrum {BioNetStat} | R Documentation

## Kullback-Liebler divergence among the spectral density functions of two or more graphs

### Description

'KLspectrum' computes the Kullback-Liebler divergence among the spectral density functions of two or more graphs

### Usage

    KLspectrum(f)

### Arguments

`f` | a list containing the components 'x' and 'densities'. The first element is the vector 'x' of 'npoints' coordinates of the points where the density function i estimated, and the second is a vector 'y' of the estimated density values.

### Value

returns a list containing the components 'theta' and 'partial'. 'theta' is a value representaing the Kullback-Liebler divergence among the corresponding distributions. 'partial' is a vector of KL divergences between each network distribuiton and the average spectral distribution.

### See Also

`graph.strength`

`density`

### Examples

    A<-list()
    A[[1]]<-as.matrix(as_adj(erdos.renyi.game(30,0.6,directed = FALSE)))
    A[[2]]<-as.matrix(as_adj(barabasi.game(30,power = 1,directed = FALSE)))
    A[[3]]<-as.matrix(as_adj(watts.strogatz.game(1,30,2,0.3)))
    f<-nSpectralDensities(A, bandwidth="Sturges")
    KLspectrum(f)

[Package BioNetStat version 1.12.0 Index]