R/vorob_threshold.R

Defines functions vorob_threshold

Documented in vorob_threshold

vorob_threshold <- function(pn){
  if(is.null(pn)) {return(0.5)}
  
  M <- length(pn)
  integ.pn <- mean(pn)
  pn.sort <- sort(pn)
  index <- (1-integ.pn)*M
  index.floor <- floor(index)
  index.cap <- min(M,index.floor+1)
  wbig <- index - index.floor
  wsmall <- 1- wbig
  alpha <- pn.sort[index.floor]*wsmall + pn.sort[index.cap]*wbig
  return(alpha)
}

Try the KrigInv package in your browser

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

KrigInv documentation built on Sept. 9, 2022, 5:08 p.m.