R/entropy.wts.R

Defines functions entropy.wts

Documented in entropy.wts

#' Entropy
#'
#' Entropy weights. Original script from HPbayes_0.1
#' @param w
#' @keywords entropy
#' @export
#' @examples
#' entropy.wts() 

entropy.wts <- function(w) {
      n <- length(w)
      num <- w * log(w)
      den <- log(n)
      ans <- -sum(num/den, na.rm = TRUE)
      return(ans)
}
milokmilo/Stranded documentation built on May 22, 2019, 11:53 p.m.