Could someone please help me figure out how to adjust my code so that it gives better predictions? Right now they are way to high.

I'm wondering if it is something to do with the holiday lag. I'm not sure if I am using the lower_window and upper_window correctly. How can I adjust my code to have weekly seasonality and to reflect the holiday lags? Normally there is a surge in sales before the holiday and then sales lag after the holiday, so I wasn't sure how to create windows that reflect that.

#sales projections for CSD using Prophet
memorial <- data_frame(
    holiday = 'memorialday',
    ds = as.Date(c('2015-05-25','2016-05-30','2017-05-29',
    lower_window = -2,
    upper_window = 0
easter <- data_frame(
  holiday = 'easterday',
  ds = as.Date(c('2015-04-05','2016-03-27','2017-04-16',
  lower_window = -2,
  upper_window = 0
labor <- data_frame(
  holiday = 'laborday',
  ds = as.Date(c('2015-09-07','2016-09-05','2017-09-04',
  lower_window = -1,
  upper_window = 0

holidays <- bind_rows(memorial,easter,labor)
n <- prophet(holidays = holidays)
n <- add_country_holidays(n,country_name = 'US')
colnames(Group_8_sales_projection_input_data) = c('ds','y')
n <- fit.prophet(n,Group_8_sales_projection_input_data)
future <- make_future_dataframe(n,periods = 365)
forecast <- predict(n, future)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.