https://github.com/cran/ftsa
Raw File
Tip revision: 84065fc768fe9969aa92efdb19e64d2b6a25df33 authored by Han Lin Shang on 29 July 2012, 09:02:07 UTC
version 3.4
Tip revision: 84065fc
mape.R
`mape` <- function(forecast, true)
{
     if (length(forecast) != length(true))
         stop("MAPE: the lengths of input vectors must be the same.")
     err = mean(100 * abs((true - forecast) / true))
     return(round(err, 6))
}

back to top