https://github.com/cran/ftsa
Raw File
Tip revision: 77c242dfb5c0095ef1c2795adcaa98ebe4e95b82 authored by Han Lin Shang on 12 March 2015, 08:20:53 UTC
version 4.2
Tip revision: 77c242d
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