R/mse.R

#' calculates mean squared error from predictions vs actual for continuous data
#'
#' \code{mse(predictions, actual)}
#'
#' @param predictions vector of predicted values
#' @param actual vector of actual values
#'
#' @details means squared error is simply the sum of squared differences
#' between predictions and actual values divided by the number of values.

mse = function(predictions, actual){
  sum((predictions - actual)^2)/length(actual)
}
helophilus/ColsTools documentation built on May 30, 2019, 4:03 p.m.