https://github.com/cran/ftsa
Raw File
Tip revision: 9e03f23f9547770ed366fc748f731a440ca2a09d authored by Han Lin Shang on 01 February 2012, 08:13:26 UTC
version 3.1
Tip revision: 9e03f23
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