Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Provided a p.f. of a discrete random variable, or a joint p.f. for several random variable, is there any software package to calculate the entropy, joint entropy, information content, mutual information, etc? If it can be used in a C# program, that'll be great.

share|cite|improve this question
R has a package called entropy. – Stefan Hansen Feb 6 '14 at 9:19
Thanks. If you change your comment to an answer, I will mark it. BTW, is there any Python option? – smwikipedia Feb 6 '14 at 9:45
Like this? – Stefan Hansen Feb 6 '14 at 9:51
That looks awesome. Could you re-post your 2 comments as an answer so I can mark it? – smwikipedia Feb 6 '14 at 10:01
If you already know the p.m.f. it is not difficult to calculate these quantities. – Memming Feb 7 '14 at 16:44
up vote 2 down vote accepted

R has a package called entropy which allows you to calculate quantities such as entropy and mutual information. There is also a module called pyentropy for Python that allows you calculate similar quantities.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.