https://github.com/cran/ftsa
Raw File
Tip revision: 415368d78ea30230e9017d72e83432baec81b1c9 authored by Han Lin Shang on 11 May 2010, 00:00:00 UTC
version 1.7
Tip revision: 415368d
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