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