I am doing forecasting with Prophet on the data given below but when I run my code it gives me an error. Please, anyone, help me.
My data:
structure(list(ds = structure(c(5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5), class = "Date"),
y = c(19, 16, 20, 13, 13, 42, 40, 33, 19, 16, 16, 33, 51,
43, 13, 16, 14, 22, 16, 16, 13, 19, 22, 22, 18, 26, 18, 34,
20, 43, 42, 24, 31, 29, 31, 25, 28, 13, 29, 31, 38, 21, 24,
13, 15, 17, 16, 28, 16, 22, 16, 17, 14, 16, 14, 17, 18, 17,
16, 17, 17, 18, 19, 16, 17, 28, 24, 17, 18, 20, 17, 17)), row.names = c(NA,
-72L), class = c("tbl_df", "tbl", "data.frame"))
My code:
m4 <- prophet(data4)
future4 <- make_future_dataframe(m4, periods = 3)
forecast4 <- predict(m4, future4)
tail(forecast4[c('ds', 'yhat', 'yhat_lower', 'yhat_upper')])
forecast4$yhat
Error:
Disabling yearly seasonality. Run prophet with yearly.seasonality=TRUE to override this.
Disabling weekly seasonality. Run prophet with weekly.seasonality=TRUE to override this.
Disabling daily seasonality. Run prophet with daily.seasonality=TRUE to override this.
Error in FUN(X[[i]], ...) : Stan does not support NA (in t) in data
In addition: Warning message:
In min(dt[dt > 0]) : no non-missing arguments to min; returning Inf
failed to preprocess the data; optimization not done
Error in if (m$stan.fit$return_code != 0) { : argument is of length zero