Hi,
I am new to tsibble and fable and trying to perform time series forecasting using fable.
I have a dataset with 4 variables - Date (as 2020 01), Location(as USA, Canada, and 6 more), Brands(as A, B, C, D), and Sales(in quantities)
I first converted this data frame to a tsibble object as follows:
df <- df%>%
mutate(Date = yearmonth(as.character(Date)))%>%
as_tsibble(key = c(Location, Brands), index = Date)
After this I tested out modeling, forecasting (5 years) and plotting forecast for just one time series as Brand A and USA. It worked fine including the forecast plots. However, when I try to model all time series at once with the following code, it works partially showing the mable as normal, but also throws error before displaying the mable as shown below.
Code:
fit <- df %>%
model(
snaive = SNAIVE(Sales ~ lag("year")),
ets = ETS(Sales),
arima = ARIMA(Sales)
)
fit
Error:
8 errors (1 unique) encountered for snaive
[8] .data contains implicit gaps in time. You should check your data and convert implicit gaps into explicit missing values using tsibble::fill_gaps()
if required.
8 errors (1 unique) encountered for ets
[8] .data contains implicit gaps in time. You should check your data and convert implicit gaps into explicit missing values using tsibble::fill_gaps()
if required.
8 errors (1 unique) encountered for arima
[8] .data contains implicit gaps in time. You should check your data and convert implicit gaps into explicit missing values using tsibble::fill_gaps()
if required.
I have checked the data and I don't find any missing values at all.
Because of this error, I believe the forecast are not performed right - the plot of forecast is also flat.
Can you please help? Thank you!