Learn R Programming

cummeRbund (version 2.14.0)

JSdistFromP: Jensen-Shannon distance on rows from a pre-defined vector of probabilities

Description

JSdist takes a matrix of expression probabilites (calculated directly or output from makeprobs()) and returns a matrix of Jensen-Shannon distances between individual rows and a specific vector of probabilities (q)

Usage

JSdistFromP(mat,q)

Arguments

mat
A matrix of expression probabilities (e.g. from makeprobs())
q
A vector of expression probabilities.

Value

A vector of JS distances

Details

Returns Jensen-Shannon distance for each row of a matrix of probabilities against a provided probability distribution (q)

References

None

Examples

Run this code

mat<-matrix(sample(1:50,50),10)
q<-c(100,4,72,8,19)
q<-q/sum(q)
js.distance<-JSdistFromP(mat,q)

Run the code above in your browser using DataLab