R/k_ml.R

Defines functions k_ml

Documented in k_ml

k_ml <-
function(xs,closed=FALSE,ll=0.001,ul=0.999) {
  if(closed) {
    S <- length(xs)
    i <- 1:S
    N <- sum(xs)
    khat <- N/(sum(xs*i))
  } else {
    out <- uniroot(fobj,c(ll,ul),tol=1e-20,check.conv=TRUE,xs)
    khat <- out$root
  }
  return(khat)
}

Try the MLpreemption package in your browser

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

MLpreemption documentation built on Feb. 11, 2021, 5:07 p.m.