# Scaling of standard deviation for forecast error

I am doing inventory optimization for my firm and need to compute the safety stock for a couple of products. I have learned that the correct quantity to consider in calculating the safety stock is the standard deviation of the forecast error.

Currently I have have observed one year's monthly demand data $$d_1, d_2,\ldots,d_{12}$$, and correspondingly I have the monthly demand forecast $$\hat{d}_1,\hat{d}_2,\ldots,\hat{d}_{12}$$. I have found the forecast error $$e_i = d_i-\hat{d}_i$$, and the (squared) standard deviation for the forecast error $$\sigma^2 = \frac{1}{11}\sum (e_i - \bar{e})^2$$, where $$\bar{e}=\frac{1}{12}\sum e_i$$ is the mean of forecast error.

But somehow, in planning the inventory policy it is more convenient to have the daily demand data, the way we do this is to use the monthly demand data and divide each of them by $$30$$ to have a daily demand. So my question is how should we scale the corresponding standard deviation for the forecast error from month to day. Is dividing $$\sigma$$ by $$\sqrt{30}$$ reasonable?

Let $$(x_i)_{i\le n}$$ and $$(\hat x_i)_{i\le n}$$ be sequences of observed data and forecast values respectively. Suppose we wish to split each $$x_i$$ equally over $$m$$ elements so that $$(x_i)_{i\le n}$$ becomes $$(y_j)_{j\le mn}$$ where $$y_j=x_{\lceil j/m\rceil}/m$$.

Denote the forecast error by $$\varepsilon_i$$ and its variance by $$\sigma_\varepsilon^2$$. Assuming that* $$(\hat x_i)_{i\le n}$$ becomes $$(\hat y_j)_{j\le mn}$$ where $$\hat y_j=\hat x_{\lceil j/m\rceil}/m$$, let $$E_j=y_j-\hat y_j$$. Then $$\overline E=\frac1{mn}\sum_j(y_j-\hat y_j)=\frac 1m\bar\varepsilon$$ and \begin{align}(mn-1)\sigma_E^2&=\sum_j\left(y_j-\hat y_j-\frac1m \bar\varepsilon\right)^2\\&=\sum_j(y_j-\hat y_j)^2-\frac nm\bar\varepsilon^2\\&=\frac1m\left(\sum_i\varepsilon_i^2-n\bar\varepsilon^2\right)=\frac{n-1}m\sigma_\varepsilon^2.\end{align} Hence $$\sigma_E=\sigma_\varepsilon\sqrt{\frac{n-1}{m(mn-1)}}.$$ So in your case with $$m=30$$ and $$n=12$$, the SD of the daily forecast error is around $$3.2\%$$ of that of the monthly forecast error. It should be noted that when $$m$$ is large we have the reasonably good approximation $$\sigma_E\approx\sigma_\varepsilon/m$$.

* This does not necessarily hold. Given the split in observed data you may need to re-run your model to obtain a new set of forecast values, whose sum may differ from that originally.

• Thanks! This is what I have been trying to do, I think that we have set $y_j = x_{[j/m]}/m$, for example if the demand for April is $30$, then we just use $30/30 = 1$ to be the daily demand for April.
– TTY
Jan 8 at 14:30
• one more thing, the quantity $\sum \epsilon^2_i - n\bar{\epsilon}^2$ should sum to $(n-1)\sigma_{\epsilon}^2$, so the factor being divided is $\sqrt{\frac{n-1}{(mn-1)m}}$
– TTY
Jan 8 at 14:55
• Another typo! I had been wondering why $\sigma_E/\sigma_\varepsilon$ was so small. Jan 8 at 15:09

EDIT I believe the question can be rephrased as: what is the method of converting $$\sigma_1$$ to $$\sigma_2$$, where one is in a different time dimension than the other. Now, for most inventory systems, the following model satisfactorily captures the required relationship (Silver, 1998):

$$\sigma_m = m^c\sigma_1$$, where $$m$$ is the multiplier that connects both time dimension: so if $$\sigma_1$$ is days, and $$\sigma_m$$ is in months, $$m$$ is $$30$$. $$c$$ is a coefficient that needs to be estimated. Then to find this coefficient , what you can do is, is to first calculate a forecast and find the associated forecast error by using:

$$e_i(m) = \sum_{r=1}^m \hat{d}_{t, t+r} - \sum_{r=1}^m \hat{d}_{t+r}$$

So the forecast is compared to the actual demand that resulted over the immediate period of duration $$m$$. We ofcourse do this for several values of $$m$$. Then for each value of $$m$$ the sample standard deviation of forecast errors is computed used as an estimate of $$\sigma_m$$,

$$\sigma_m = \{\frac{1}{n-1}\sum_{t} [e_t(m)-\bar{e}(m)]^2]\}^\frac{1}{2}$$, where $$\bar{e}(m) = \frac{\sum_{t} e_t(m)}{n}$$ is the average error for the $$m$$ under consideration.

We can then estimate $$m^c$$ by looking at the ratio $$\frac{\sigma_m}{\sigma_1}$$

or we can find the slope of a regression line by taking the logarithm of this ratio:

$$c \times log\space m$$

From empirical analysis, we know that $$0.5$$ is a reasonable approximation that serves as a good fit. This gives us: $$\sigma_m = \sqrt{m}\sigma_1$$ Ofcourse, you could nowadays, calculate this relationship exactly per SKU.

• I think $\sigma$ should be divided by (approximately) $30$ not $\sqrt{30}$ (see my answer). In a handwaving manner, we can see this by noting that $\Bbb V[aX]=a^2\Bbb V[X]$. Jan 8 at 15:19
• well, the mistake is calculating $\sigma$ from you forecast error deviation, rather than the forecast error itself. When having $\sigma$, it is a normal approach in inventory control to scale by $\sqrt{days}$. The deviation during lead time is also calculated as $\sigma_{day} \times \sqrt{days during lead time}$. It depends on the correlation between the variances on daily level, but a reasonable approach is to assume there isn't any. Enough literature available on this matter. Jan 8 at 15:50
• I think the reason for $\sqrt{30}$ is that assuming the daily demands are identically distributed and uncorrelated, then the monthly demand is the sum of the daily demands and hence $\mathbb{V}[D_{Month}]=\mathbb{V}[D_1+\cdots + D_{30}]=30\mathbb{V}$. But what I am confused about is that evenly distributing the monthly demand to daily demand somehow invalidates the assumption that the daily demands are uncorrelated...
– TTY
Jan 8 at 16:26
• I edited my answer. I think/hope this gives more clarity on my thoughts on this matter. Jan 8 at 19:17
• @Steven01123581321Thank you, I also think $\sqrt{30}$ is the right answer, but I just don't see exactly why the analysis in TheSimpliFire's seems to indicate $30$ is also a reasonable answer.
– TTY
Jan 9 at 3:56