R/theilInd.R

theilInd <-
function(samps){
  theils<-c()
  for(i in samps){
    t.i<-i/mean(samps)*log(i/mean(samps))
    theils<-c(theils,t.i)
  }#end for i
  t.out<-sum(theils)/length(theils)
  #t.out<-t.out/log(length(theils))
  return(t.out)
}

Try the binequality package in your browser

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

binequality documentation built on May 2, 2019, 9:58 a.m.