robjhyndman / forecast

Forecasting Functions for Time Series and Linear Models
http://pkg.robjhyndman.com/forecast
1.13k stars 342 forks source link

Error when using "accuracy" function with "tbats" function #95

Closed ldanai closed 9 years ago

ldanai commented 9 years ago

Hi Rob,

I tried to measure accuracy of the "tbats" model using the code below and I got an error message. Does the accuracy function work for the tbats function? What would be a simple way to measure accuracy by ME, RMSE, MAE, ...?

x = sin(c(1:200)/10) x = ts(x, frequency=10) y = msts(x, seasonal.periods=c(10)) fit = tbats(y) accuracy(fit) plot(forecast(fit, 120))

Then I got this error:

"Error in -.default(dx, fits) : time-series/vector length mismatch"

Currently I use R version 3.1.1 with RStudio.

Would appreciate if you can provide some hints. Thank you!

Regards, Danai

robjhyndman commented 9 years ago

The first argument of accuracy() should be of class forecast, not the output from a modelling function.