R/MSE.r

Defines functions MSE

Documented in MSE

MSE <- 
function(actual, prediction) {
  if (length(actual) != length(prediction)) stop("actual and prediction have different lengths")
  
  n <- length(actual)
  
  res <- mean((actual-prediction)^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.