R/ocv.r

Defines functions ocv

Documented in ocv

ocv <- function(mod){       # leave-one-out cross-validation
  y <- mod$model[,1] 
  b <- coef(mod)
  A <- hatvalues(mod)
  ocv <- mean((y-fitted(mod))^2/(1-A)^2)
  return(ocv)
}

Try the blmeco package in your browser

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

blmeco documentation built on Dec. 5, 2019, 5:09 p.m.