-1

I want to fetch MAPE error of arima model after fitting model. below is the summary of arima model

Series: train ARIMA(1,1,1)

Coefficients: ar1 ma1 0.4472 -0.925 s.e. 0.0310 0.014

sigma^2 estimated as 211188552: log likelihood=-14820.68 AIC=29647.36 AICc=29647.38 BIC=29662.98

Training set error measures: ME RMSE MAE MPE MAPE MASE ACF1 Training set 413.1383 14516.15 9886.802 -17.77737 27.93304 0.9202813 -0.008861643 num [1, 1:7] 413.1 14516.1 9886.8 -17.8 27.9 ... - attr(*, "dimnames")=List of 2 ..$ : chr "Training set" ..$ : chr [1:7] "ME" "RMSE" "MAE" "MPE" ...

Zeeshan
  • 1,208
  • 1
  • 14
  • 26
learner
  • 43
  • 1
  • 6

2 Answers2

1

use this code

  mape_error<-accuracy(fit)
  mape_error<-data.frame(mape_error)
  mape<-mape_error$MAPE
Zeeshan
  • 1,208
  • 1
  • 14
  • 26
0

library(forecast)

This gets your point predictions, decide on an horizon(h) length pred <- forecast(fit, h = 3)$mean

m_pred and actual(same length as h) have to be the same length MAPE <- accuracy(m_pred, actual)[5]
RMSE<- accuracy(m_pred, actual)[2]
etc.