https://github.com/cran/ftsa
Raw File
Tip revision: 50f611d7d698393a7b12fa2a9d13b18e51308469 authored by Han Lin Shang on 05 August 2015, 09:30:47 UTC
version 4.4
Tip revision: 50f611d
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