[Biojava-dev] Distributions

Schreiber, Mark mark.schreiber at agresearch.co.nz
Tue Feb 25 11:57:22 EST 2003


Hi -

I have pulled out my copy of the Shannon paper and I'm 99% sure that the
shannon entropy calculation should be what is was before. Can someone
change it back or convince me I'm wrong.

- Mark

> -----Original Message-----
> From: Lachlan Coin [mailto:lc1 at sanger.ac.uk] 
> Sent: Thursday, 20 February 2003 10:31 p.m.
> To: jhidalgo at elmonte.es
> Cc: biojava-dev at biojava.org
> Subject: Re: [Biojava-dev] Distributions
> 
> 
> If you have a CVS checkout, you will find the code in
> 
> /biojava-live/src/org/biojava/bio/dist/DistributionTools.java
> 
> so, to calculate shannon entropy for a Distribution observed 
> to base 2, you can put
> 
> Map entropy = 
> DistributionTools.shannonEntropy(observedDistribution, 2)
> 
> which gives you a map of the information content of each 
> symbol in the alphabet (i.e. log(1/p(i))
> 
> You can also do:
> 
> double bits = 
> DistributionTools.bitsOfInformation(observedDistribution)
> 
> to get the total information context (which is just the 
> expectation of the above map under the observed distribution: 
> sum_i p(i)*log(1/p(i))
> 
> 
> Lachlan
> 
> 
> 
> 
> 
> 
> 
> On Thu, 20 Feb 2003 jhidalgo at elmonte.es wrote:
> 
> > Can anyone send me an example of ShannonEntropy calculation code?
> >
> > _______________________________________________
> > biojava-dev mailing list
> > biojava-dev at biojava.org 
> > http://biojava.org/mailman/listinfo/biojava-dev
> >
> 
> -------------------------------------------------------------
> Lachlan Coin
> Wellcome Trust Sanger Institute		Magdalene College
> Cambridge  CB10 1SA			Cambridge CB30AG
> Ph: +44 1223 494 820
> Fax: +44 1223 494 919
> ------------------------------------------------------------
> 
> _______________________________________________
> biojava-dev mailing list
> biojava-dev at biojava.org 
> http://biojava.org/mailman/listinfo/biojava-dev
> 
=======================================================================
Attention: The information contained in this message and/or attachments
from AgResearch Limited is intended only for the persons or entities
to which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipients is prohibited by AgResearch
Limited. If you have received this message in error, please notify the
sender immediately.
=======================================================================



More information about the biojava-dev mailing list