R/mregdepth.R

mregdepth <- function(coef, x, y, ndir = 1000)
{
  if(is.null(dim(x))) x = matrix(x, ncol = 1)

  yest = cbind(1,x)%*%coef
  res = y - yest
  u = runifsphere(ndir,length(coef))
  rdtmp = as.vector(res)/t(u%*%t(cbind(1,x)))<0
  min(colSums(rdtmp))
}

Try the DepthProc package in your browser

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

DepthProc documentation built on May 2, 2019, 6:22 p.m.