R/compareForecastAccuracy.R

compareForecastAccuracy = function(test, forecasts = NULL, fits=NULL){
  if(is.null(forecasts)){
    h = length(test)
    forecasts = lapply(fits, function(f)forecast::forecast(f, h=h))
  }
  t(sapply(forecasts, function(f)forecast::accuracy(f, test)[2,]))
}
bplloyd/Core documentation built on May 13, 2019, 2:24 a.m.