I have retail sales data from Jul'17 to Jul'18, and would like to extend the series to the period Jan'17 ~ Jun'17, for which I don't have any data.
Since this is retail data I want to use the prophet
package, as it accounts holidays and monthly/yearly trends. However I can't seen to make it predict past data, as I can't call make_future_dataframe
to give me a past period.
I can't share data, so in my example y
was generated from rnorm()
data = structure(list(ds = structure(c(17683, 17652, 17622, 17591, 17563,
17532, 17501, 17471, 17440, 17410, 17379, 17348), class = "Date"),
y = c(104.668732663406, 98.3902718818212, 109.061616978181,
109.838504824619, 111.732728009024, 102.108143707743, 99.4680518699638,
84.228075141372, 110.844516862675, 92.5728013090567, 80.8504745693786,
108.721168531315)), .Names = c("ds", "y"), row.names = c(NA,
-12L), class = "data.frame")
m <- prophet(data,seasonality.mode = "multiplicative",yearly.seasonality = T)
future <- make_future_dataframe(m, periods = 6, freq = "1 month")
forecast <- predict(m, future) %>% data.table()
Is there a way I can make prophet
give me past predictions without having to fill in fake dates?
Thanks