Defines functions mrae

mrae <- function(forecast, forecastbench, true)
  if (length(forecast) != length(true))
      stop("MRAE: the lengths of input vectors must be the same.")
  ferror = (true - forecast)
  ferrorbench = (true - forecastbench)
  relativerror = mean(abs(ferror / ferrorbench))
  return(round(relativerror, 6))

Try the ftsa package in your browser

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

ftsa documentation built on Jan. 13, 2021, 6:21 p.m.