https://github.com/cran/ftsa
Raw File
Tip revision: 9120e042a4e1ace638f4af6dae1ed85da1e97d81 authored by Han Lin Shang on 24 October 2012, 06:39:13 UTC
version 3.6
Tip revision: 9120e04
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