https://github.com/cran/ftsa
Raw File
Tip revision: 7621951a183186ccd8706e35121ccdc4dbfddd1a authored by Shang H on 10 December 2014, 07:56:05 UTC
version 4.1
Tip revision: 7621951
smape.R
`smape` <-
function(forecast, true)
{
     if (length(forecast) != length(true))
         stop("SMAPE: the lengths of input vectors must be the same.")
     err = mean(200 * (true - forecast) / (true + forecast))
     return(round(err, 6))
}
back to top