https://github.com/cran/ftsa
Raw File
Tip revision: 25c4a6c8cb332c73650b2ee837501d2a7cedc3e3 authored by Han Lin Shang on 07 December 2010, 08:20:21 UTC
version 2.3
Tip revision: 25c4a6c
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