facebook / facebook/prophet

Daily seasonality with regular gaps in the time series

Aberta
#749 2 comentários 1 reação 0 responsáveis Ver no GitHub
enhancement
Linguagem predominante
Python
Estrelas
20.4k
Forks
4.6k
Merge médio
19h 52min
PRs com merge (30d)
1

Descrição

I have been testing prophet with hourly sales data. The store is only open between 7 am and 5 pm each day. When reviewing the documentation it says if the the sub-daily data has constant missing values, then you should only predict future values that coincide with the sub-daily data that you have. So in my case that would be future values between 7 am and 5 pm. I totally get that. But I wanted to see the difference in performance if I added the missing hours each day and just assigned them $0 dollars in sales. Both of the models fit the trend/seasonality well, but what I am struggling to understand is the hourly impact on the model when I do not have the closed hours in the data.

Here is the model using 24 hours of the day with $0 assigned to closed hours.

![all hours model](https://user-images.githubusercontent.com/40872066/48924496-db788980-ef1d-11e8-8f0c-11d13ae6b028.JPG)

Here is the model using only the open hours (7 am to 5 pm):

![open hours model](https://user-images.githubusercontent.com/40872066/48924488-c4d23280-ef1d-11e8-8952-e947bd30d9c9.JPG)

In the following daily component images below, you can see the model using 24 hours of the day captures the daily trend as I would have expected, where the hours around lunch time add more, and the closed actually detract a little. This is what we expect the daily seasonality to be.

![all hours daily component](https://user-images.githubusercontent.com/40872066/48924586-a4ef3e80-ef1e-11e8-9b8a-742975c0aae6.JPG)

But when I only use the opening hours, the daily components comes out below, where the closed hours have a massive impact, but of course they are not being used to predict the future values. So my question is, why is the model applying so much to the trend during closed hours when it's got no data related to those hours?
![open hours daily component](https://user-images.githubusercontent.com/40872066/48924601-e1229f00-ef1e-11e8-8d93-31480fb7c1ad.JPG)

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.