R/loessGCV_fn.R

#loessGCV function in statTarget edited as commented

loessGCV_fn<-function (x) 
{
  if (!(inherits(x, "loess"))) 
    stop("Error: argument must be a loess object")
  span <- x$pars$span
  n <- x$n
  traceL <- x$trace.hat
  sigma2 <- sum(resid(x)^2)/(n - 1)
  gcv <- n * sigma2/(n - traceL)^2
  result <- list(span = span, gcv = gcv)
  result
}

Try the NormalizeMets package in your browser

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

NormalizeMets documentation built on May 1, 2019, 10:26 p.m.