Hourly sales predictions 
I have some time series (you can see its vizualization on picture above. It is hourly sales of some product. My goal is to make hourly prediction of its demand.I am  confused, because at almost all points my time series is zero. 
Could someone suggest which algorithm and loss function should i choose to be able to predict something except zero? There is no any external regressors. Thank you a lot.
 A: Time series like this - integer-valued with "many" zeros - are called intermittent demand. For forecasting:


*

*The classical approach is crostons-method, which exponentially smoothes the inter-demand interval and nonzero demands separately, forecasts them out and uses the ratio as a mean demand forecast. You can read about Croston's method in pretty much every business or demand forecasting textbook.

*Alternatively, you could simply run an overall average. Or use a seasonal method if you suspect seasonality (e.g., within days), e.g., seasonal exponential smoothing. If you suspect multiple-seasonalities (e.g., intra-daily and intra-weekly), a tbats model may be possible, even if the (often tacit) assumptions of conditionally normally distributed observations do not hold.

*Or you could run a Poisson or Negative Binomial regression, potentially with periodic dummies to account for seasonalities.


Note that you should not use the Mean Absolute Error (mae) for intermittent demands, because it will be minimized by biased forecasts, probably the flat zero forecast. Use the Mean Squared Error (mse) instead. Or even better: calculate full predictive densities and use proper scoring-rules.
In terms of literature, Morlidge (2015, Foresight) discusses the shortcomings of the mae. Kolassa (2016, International Journal of Forecasting) does the same, presents Poisson and NB regression (and other models) and uses scoring-rules. A textbook on intermittent demand forecasting by Boylan and Syntetos is in preparation and should hopefully appear in the next few months.
