R/entropy.R

entropy <-
function(dist)
{
	dist <- dist[dist!=0]
	return(-sum(dist*log(dist))/log(length(dist)));
	
}

Try the pdc package in your browser

Any scripts or data that you put into this service are public.

pdc documentation built on May 2, 2019, 9 a.m.