R/startberngamma.R

startberngamma <- function(x){
  p <- sum(x>0)/length(x)
  x <- x[x>0]
  m <- mean(x)
  v <- var(x)
  start <- list(prob=p,
                scale = v/m,
                shape = m^2/v)
  return(start)
}

Try the qmap package in your browser

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

qmap documentation built on May 1, 2019, 7:31 p.m.