R/errorMeasures.R

Defines functions errorMeasures

Documented in errorMeasures

errorMeasures <- function(model = NULL, obs = NULL, pred = NULL, na.rm = TRUE, rm.dup = FALSE) {
  # version 1.0 (2 Oct 2024)

  obspred <- inputMunch(model, obs, pred, na.rm = na.rm, rm.dup = rm.dup)
  obs <- obspred[ , "obs"]
  pred <- obspred[ , "pred"]

  SE <- (obs - pred) ^ 2
  MSE <- mean(SE)
  Brier_score <- MSE
  RMSE <- sqrt(MSE)
  # SSE <- sum(SE)

  return(list(RMSE = RMSE, MSE = MSE, Brier_score = Brier_score))
}

Try the modEvA package in your browser

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

modEvA documentation built on Oct. 30, 2024, 1:06 a.m.