R/bh.m0.estimate.r

Defines functions bh.m0.estimate

Documented in bh.m0.estimate

bh.m0.estimate=function(sorted,m){
  k=2:m
  m0.k=(m+1-k)/(1-sorted[-1])
  diffs=diff(m0.k,lag=1)
  indicators= diffs>0
  optimal.k=ifelse(any(indicators) , min( k[indicators] ) , 1)
  m0=min(ceiling(m0.k[optimal.k]),m)
  stopifnot(m0 <=m ,m0 > 0)
  return(m0)
}

Try the mcp.project package in your browser

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

mcp.project documentation built on May 2, 2019, 4:52 p.m.