R/NMSE.r

Defines functions NMSE

Documented in NMSE

NMSE <- 
function(actual, prediction, train.actual) {
  if (length(actual) != length(prediction)) stop("actual and prediction have different lengths")
  
  n <- length(actual)
  
  res <- sum( (actual-prediction)^2 ) / sum( (actual-mean(train.actual))^2 )
  
  res
}

Try the TSPred package in your browser

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

TSPred documentation built on June 26, 2018, 5:04 p.m.