The code below gets a: error in mean(abs((y_true - y_pred)/y_true)) : argument "y_true" is missing, with no default
I've seen MAPE used on forecasts. Can one use this and similar methods on models? Or is there some other R package that would work?
Edit 1: Seems lke MAPE wants a forecast. While my arima:
> class(arima)
[1] "forecast_ARIMA" "ARIMA" "Arima"
might be a forecast MAPE does not work. Using summary, i get:
Training set error measures:
ME RMSE MAE MPE
Training set 0.003245791 1.473989 1.051721 -0.001574146
MAPE MASE ACF1
Training set 0.5306977 0.9908161 -0.001193281
Doing a ??MAP gets me nine packages (with many different names for methods ans parameters). This is confusing. Is there any doc on which types of objects work with what?
Original code:
symbols <- c("SPY","EFA", "IJS", "EEM","AGG")
prices <- getSymbols(symbols,
src = 'yahoo',
from = "2012-12-31",
to = "2017-12-31",
auto.assign = TRUE,
warnings = FALSE)
ts<-SPY$SPY.Close
autoplot(ts)
arima = auto.arima(ts)
library(MLmetrics)
MAPE(arima)