# How to compute RMSE for TBATS

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

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)

• Thank you Dr Hyndman. I knew how to compute it myself but thought there might be a specific command for that. Thanks – user12 Sep 18 '14 at 12:20
• 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? – user12 Sep 18 '14 at 16:24
• 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(). – Rob Hyndman Sep 18 '14 at 22:34
• The str command is highly undervalued. Apply it to any object to get detailed information. – Peter Lustig Sep 25 '14 at 12:47