gets: R/rsquared.R

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
rsquared <-
function(object, ...)
{
  classOK <- class(object) %in% c("arx", "gets", "isat")
  if(!classOK){ stop("Object not of class 'arx', 'gets' nor 'isat'") }
  TSS <- sum( (object$aux$y - mean(object$aux$y))^2 )
  residsTrimmed <- na.trim(object$resids)
  RSS <- sum(residsTrimmed^2)
  result <- 1 - RSS/TSS
  ##to do: adjusted R-squared
  return(result)
}

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.