R/rmspe.R

Defines functions rmspe

rmspe <- function(forecast, true)
{
     if (length(forecast) != length(true))
         stop("RMSPE: the lengths of input vectors must be the same.")
     err = sqrt(mean((100 * (true - forecast) / true)^2))
     return(round(err, 6))
}

Try the ftsa package in your browser

Any scripts or data that you put into this service are public.

ftsa documentation built on May 29, 2024, 2:47 a.m.