R/relmse.R

Defines functions relmse

relmse <- function(forecast, forecastbench, true)
{
  if (length(forecast) != length(true))
      stop("RelMAE: the lengths of input vectors must be the same.")
  ferror = mean((true - forecast)^2)
  ferrorbench = mean((true - forecastbench)^2)
  relativerror = 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 May 29, 2024, 2:47 a.m.