https://github.com/cran/ftsa
Tip revision: 50f611d7d698393a7b12fa2a9d13b18e51308469 authored by Han Lin Shang on 05 August 2015, 09:30:47 UTC
version 4.4
version 4.4
Tip revision: 50f611d
mdase.R
mdase = function(forecast, outsampletrue, insampletrue)
{
if(length(forecast) != length(outsampletrue))
stop("MdASE: the lengths of input vectors must be the same.")
n = length(insampletrue)
insamplerr = vector(, (n - 1))
for(i in 1:(n - 1))
{
insamplerr[i] = abs(insampletrue[i+1] - insampletrue[i])
}
qt = (outsampletrue - forecast)/(sum(insamplerr)/(n - 1))
scalederror = median(abs(qt))
return(round(scalederror, 6))
}