How to model stocks of a warehouse time series? Warehouse buys products from producer irregularly in bulk quantities. If the warehouse buys a lot of product units at one time the warehouse stops buying for several weeks (let's say week is a time unit). The more they buy (i.e. because of the price promotion), the farther they postpone future buying. I have time series of producer sales to warehouse but I don't know how many units leaks out of the warehouse to retailers - retail shops may also buy irregularly from the warehouse. What is the approach to model stocks of the warehouse from the producer point of view? 
How many units the warehouse will buy in the next future week? 
How much of the current producer sales to warehouse is because of the low stocks in the preceding weeks?
 A: Prz.  In general an ARIMA model is an optimization of the number of previous periods to use in the weighting scheme AND the values of the coefficients . You are assuming 3 periods and the coefficients are equal. Care must be taken to identify level shifts , seasonal pulses, pulses and Local time trends while ensuring that the parameters (coefficients) haven't changed over tome and that the error variance is homogeneous. For more on ARIMA modelling and Intervention Detection please see work by Tsay http://www.unc.edu/~jbhill/tsay.pdf and perhaps some of my previous posts here at SE https://stats.stackexchange.com/users/3382/irishstat?tab=activity. Hope this helps. If you wish to post an example time series, I will try and give you some pointers on this data.
A: Some idea is like this:
Y(t) = constant - [Y(t-1) +Y(t-2) +Y(t-3)]
Where [Y(t-1) +Y(t-2) +Y(t-3)] means the sum of recent past orders from the warehouse. Here in this example I used past 3 observations but the number of observations summed may be optimized.
Instead of constant one might use rolling average multiplied by the number of observations summed +1. 
