## 3 Materials and Methods
\right.\]  
Forecasting accuracy for the delivery week \(d\) (\(FA_{d}\)) can be found using the following equation:  
\[FA_{d}=\frac{\sum_{i=1}^{\text{DNW}_{d}}A_{i}}{DNW_{d}}\times 100\% \tag{5}\]Total satisfied demand next week (\(TSD_{d}\)) can be found as follows:  
\[TSD_{d}=\sum_{i=1}^{D\text{DNW}_{d}}SO_{i} \tag{6}\]  
\(A_{i}\) is order expectation accuracy, which means that expectation about the order \(i\) is correct if \(A_{i}\) = 1. FA is found by finding the percentage of orders that meet the expectations. Adding the new data to the old data means that the same order might be in the old data with a value of \(SO\) = 0, and in the new data, \(SO\) = 1. Therefore, the same order might be repeated several times. All of them are with \(SO\) = 0, except the last one, with \(SO\) = 1. The function \(glm\) in R software was used. The initial results for \(ESO\) are numbers from 0 to 1. Usually, numbers greater than or equal to 0.5 are set to be 1. The other numbers less than 0.5 are set to be 0s. Therefore, the threshold value is usually 0.5 to optimize the accuracy value. In addition to the accuracy measure, which is \(FA_{d}\), the two types of errors (\(\epsilon_{1d}\) and \(\epsilon_{2d}\)) can also be estimated according to the following equation:  
\[\epsilon_{1d}+\epsilon_{2d}=1-\frac{FA_{d}}{100} \tag{7}\]  
where,  
\[\epsilon_{1d}=\frac{\sum_{i=1}^{D\text{DNW}_{d}}E1_{i}}{DNW_{d}} \tag{8}\]  
\[\epsilon_{2d}=\frac{\sum_{i=1}^{D\text{DNW}_{d}}E2_{i}}{DNW_{d}} \tag{9}\]  
where,  
\[E1_{i}=\left\{ \begin{array}{ll}1&if\text{ }SO_{i}<ESO_{i}\\ 0&otherwise\\ E2_{i}=\left\{\begin{array}{ll}1&if\text{ }SO_{i}>ESO_{i}\\ 0&otherwise\\ \end{array}\right.\end{array} \right.\]  
When \(SO_{i}<ESO_{i}\), \(SO_{i}\) = 0 and \(ESO_{i}\) = 1. In addition, when \(SO_{i}>ESO_{i}\), \(SO_{i}\) = 1 and \(ESO_{i}\) = 0. The estimated demand using the logistic regression (\(LRED_{d}\)) is different from the total estimated demand using moving average or simple regression (\(SDNW_{d}\)). In other words:  
\[SDNW_{d}>LRED_{d}=\sum_{i=1}^{D\text{DNW}_{d}}ESO_{i} \tag{10}\]  
This is because most of the current orders will not be satisfied in the next week. On average, only 30% will be satisfied. Therefore, reducing \(SDNW_{d}\) is necessary to reduce type 1 error. Another accuracy measure is the accuracy of the total demand for the next delivery week (\(ADNW\)), which can be found using the following equation:  
\[ADNW_{d}=\frac{1-|TSD_{d}-SDNW_{d}|}{\frac{\sum_{i=1}^{N}TSD_{d}}{N}}\times 1 00\%=\frac{N(1-|TSD_{d}-SDNW_{d}|)}{\sum_{d=1}^{N}TSD_{d}}\times 100\% \tag{11}\]  
Lead time is usually larger than the time between deliveries, which is usually one week. In this case, there is a short lead time in which there is an order after the last delivery and served during the next delivery. It will not be considered because it is not helpful for temporal aggregation, and it is considered an outlier. The effect of orders not coming according to \(FCFS\) is measured (% \(FCFS\)) in this paper using the following method: For the previously known data, find the forecasting accuracy assuming that the total satisfied demand is already known, and then orders are sorted from the oldest to the newest. Then, assign the value of 1 for the first \(SDNW_{d}\) orders. If the \(FCFS\) principle is fully applied, this accuracy should be 100%.