https://github.com/cran/ftsa
Raw File
Tip revision: 2be2cac4679ad78e8ae44283f0200a83b4a2dab9 authored by Han Lin Shang on 09 November 2010, 10:17:30 UTC
version 2.1
Tip revision: 2be2cac
mae.R
mae = function(forecast, true)
{
    if (length(forecast) != length(true))
        stop("MAE: the lengths of input vectors must be the same.")
    err = mean(abs(true - forecast))
    return(round(err, 6))
}
back to top