R/gcvcss.R

gcvcss <-
function(eta,yty,xtx,xty,nqmat,ndpts,alpha) {
  
  gcv <- tryCatch({
    chi <- pinvsm(xtx+exp(eta)*nqmat)
    parta <- chi%*%xty
    gnum <- yty - 2*crossprod(xty,parta) + crossprod(parta,xtx%*%parta)
    ndpts*gnum/((ndpts-alpha*sum(diag(chi%*%xtx)))^2)
  }, error = function(e) yty)
  
}

Try the bigsplines package in your browser

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

bigsplines documentation built on May 2, 2019, 9:27 a.m.