R/9_pressc.R

#' @export
pressc<-function(fit){
  x<-cbind( rep(1,  nrow(as.matrix(fit$model[,-1])) ),fit$model[,-1] )
  x<-as.matrix(x)
  h<-x%*%solve(t(x)%*%x)%*%(t(x))
  e<-fit$residuals
  return(sum(    (e/(1-diag(h)))^2    ) )

}

Try the ALSM package in your browser

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

ALSM documentation built on May 2, 2019, 10:19 a.m.