2
$\begingroup$

Some forecasting models in R give error terms as their output. But for TBATS, I couldnt find out that how I can see what the RMSE for my data set is. Is there any specific command that I have to use to get this value? Thanks

$\endgroup$
4
$\begingroup$

If you look at what tbats returns, you will see variance as one component. So

fit <- tbats(x)
rmse <- sqrt(fit$variance)

will give you the RMSE.

But even if you weren't sure what that component contained, you can always compute RMSE directly from the residuals of any model:

res <- residuals(fit)
rmse <- sqrt(mean(res^2))

You can also use the accuracy function:

fc <- forecast(fit)
accuracy(fc)
$\endgroup$
  • $\begingroup$ Thank you Dr Hyndman. I knew how to compute it myself but thought there might be a specific command for that. Thanks $\endgroup$ – user12 Sep 18 '14 at 12:20
  • $\begingroup$ TBATS output does not include variance (May be Im intrepreting it wrong) but there is a parameter named sigma which I believe is RMSE. Am I right? $\endgroup$ – user12 Sep 18 '14 at 16:24
  • $\begingroup$ The above code works. variance is part of the object returned by tbats. You are confusing what is produced by print() with what is returned by tbats(). $\endgroup$ – Rob Hyndman Sep 18 '14 at 22:34
  • 2
    $\begingroup$ The str command is highly undervalued. Apply it to any object to get detailed information. $\endgroup$ – Peter Lustig Sep 25 '14 at 12:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.