MATLAB Answers

0

Create functions for renyi & shannon entropy?

How to create a function for the Renyi and Shannon formulas?
RENYI=(1/1-alpha).* log2(sum(q .^alpha))
SHANNON=-(sum (q .* log2 (q)))

  1 Comment

thanks for your reply I just want to create functions for these formulas then call it to my program and for alpha>=0 & alpha!= 1 to avoid zero and for q is probability between 0 and 1

Sign in to comment.

1 Answer

Answer by Alexander Andreychenko on 14 Jun 2016
 Accepted Answer

Could you please specify for what kind of distributions do you want to compute that (continuous, discrete)? What is the nature of the state space of the distributions? How do you treat possible 0 values in logarithm?

  1 Comment

thanks for your reply I just want to create functions for these formulas then call it to my program and for alpha>=0 & alpha!= 1 to avoid zero and for q is probability between 0 and 1

Sign in to comment.