Inventory MATERIAL FLOW SYSTEMS Overview DEMAND MODELLING INVENTORY MODELS Probability review Newsvendor problem ◦ Binomial distribution ◦ Poisson distribution ◦ Normal distribution Distribution fitting EOQ model General inventory strategy ◦ When to reorder ◦ How much to order Demand Modelling INVENTORY Binomial distribution The binomial distribution is appropriate for modeling demand when there are n customers and each of them will purchase with probability p. 𝑃𝑃 𝐷𝐷 = 𝑥𝑥 = 𝑛𝑛 𝑥𝑥 𝑝𝑝 1 − 𝑝𝑝 𝑥𝑥 𝑛𝑛−𝑥𝑥 where 𝑛𝑛 𝑛𝑛! . = 𝑥𝑥! 𝑛𝑛−𝑥𝑥 ! 𝑥𝑥 If there are 10 customers and p = 0.1, probability of selling 3 items is: 𝑃𝑃 𝐷𝐷 = 3 = 10! × 0.13 × 0.97 = 0.0574 3! 7! Q1-15 Binomial distribution The binomial distribution is appropriate for modeling demand when there are n customers and each of them will purchase with probability p. 𝜇𝜇 = 𝑛𝑛𝑛𝑛 and 𝜎𝜎 2 = 𝑛𝑛𝑛𝑛(1 − 𝑝𝑝) See here for proof. If there are 20 customers and p = 0.4: ◦ Expected demand is 20 × 0.4 = 8 ◦ Demand variance is 20 × 0.4 × 0.6 = 4.8 Q16 Poisson distribution The Poisson distribution can be appropriate for modeling demand when average demand m is known. 𝑃𝑃 𝐷𝐷 = 𝑥𝑥 = 𝑒𝑒 −𝑚𝑚 𝑚𝑚 𝑥𝑥 𝑥𝑥! If average daily demand is 10, probability of selling 7 items is: 𝑃𝑃 𝐷𝐷 = 7 = 𝑒𝑒 −10 107 = 0.0901 7! Q17 Binomial to Poisson The binomial distribution is appropriate for modeling demand when there are n customers and each will purchase with probability p. However, determining the value of n to use can be tricky in practice. As n increases, the binomial distribution approaches the Poisson distribution. Suppose a store sells an average of 10 products each day. Furthermore, the largest sale volume in a day is 20. Under this setting, we could assume 𝑛𝑛 = 20 and 𝑝𝑝 = 0.5. However, selling 100 products in a day is also possible. Hence, one can also assume 𝑛𝑛 = 100 and 𝑝𝑝 = 0.1. Q18-21 Binomial to Poisson The binomial distribution is appropriate for modeling demand when there are n customers and each of them will purchase with probability p. However, determining the value of n to use can be tricky in practice. In theory, n can be very large in many cases. As n increases, the binomial distribution approaches the Poisson distribution. Hence, the Poisson distribution suitable for modeling demand when average demand m is known. Under the Poisson distribution, mean and variance take the same value: See here and here for proof. 𝜇𝜇 = 𝜎𝜎 2 = 𝑚𝑚 Q22 Normal distribution The normal distribution can be appropriate for modeling demand when average demand 𝜇𝜇 and demand variance 𝜎𝜎 2 are both known. Similar to the Poisson distribution, the normal distribution approximates a binomial distribution when n is sufficiently large (i.e., 𝑛𝑛𝑛𝑛 > 5 and 𝑛𝑛 1 − 𝑝𝑝 > 5). Q29 However, it is more flexible than the Poisson distribution in that it allows for differing mean and variance values. Normal distribution Q23-28 The normal distribution is a continuous distribution but demand is often an integer value. Hence continuity correction is applied when estimating demand using a normal distribution: 𝑃𝑃 Demand = 5 = 𝑃𝑃 4.5 ≤ 𝑋𝑋 ≤ 5.5 = 𝑃𝑃 4.5 − 𝜇𝜇 5.5 − 𝜇𝜇 ≤ 𝑍𝑍 ≤ 𝜎𝜎 𝜎𝜎 Probabilities based on normal distributions can be obtained by looking up the standard normal table: 𝑃𝑃 𝑃𝑃 𝑃𝑃 𝑃𝑃 𝑍𝑍 𝑍𝑍 𝑍𝑍 𝑍𝑍 ≤ 𝑥𝑥 ≤ 𝑥𝑥 ≥ 𝑥𝑥 ≥ 𝑥𝑥 for positive x for negative x for positive x for negative x Linear interpolation The z-values in the standard normal table are only given up to 2 dec. pl. Linear interpolation can be used to estimate the probability p associated with a given z value that is larger and smaller than z1 and z2, respectively: 𝑝𝑝 ≈ 𝑝𝑝1 𝑧𝑧2 − 𝑧𝑧 + 𝑝𝑝2 𝑧𝑧 − 𝑧𝑧1 𝑧𝑧2 − 𝑧𝑧1 Interested students can find out more details from the URL below. https://en.wikipedia.org/wiki/Linear_interpolation#Linear_interpolation_between_two_known_points Linear interpolation Suppose we are interested in 𝑃𝑃 𝑍𝑍 ≤ 0.231 . Clearly: 𝑃𝑃 𝑍𝑍 ≤ 0.23 < 𝑃𝑃 𝑍𝑍 ≤ 0.231 < 𝑃𝑃 𝑍𝑍 ≤ 0.24 0.5910 < 𝑃𝑃 𝑍𝑍 ≤ 0.231 < 0.5948 By applying the linear interpolation formula given in the previous slide: 𝑃𝑃 𝑍𝑍 ≤ 0.231 ≈ 0.5910 0.24 − 0.231 + 0.5948 0.231 − 0.23 = 0.5914 0.24 − 0.23 Normal distribution Unlike binomial distribution, normal distribution does not require the number of customers, which can be difficult to determine in practice. Unlike Poisson distribution, normal distribution makes use of both mean and variance information. It is also easier to compute demand across multiple periods under the normal distribution. Demand across multiple periods We are often interested in demand across multiple periods. For example, we want to know the number of patients in a month. Suppose daily demand is equally likely to be 0, 1 or 2. Demand across two days is: Scenario Demand 0, 0 0 0, 1 1 0, 2 2 1, 0 1 1, 1 2 1, 2 3 2, 0 2 2, 1 3 2, 2 4 P(Demand = 0) = P(Demand = 1) = P(Demand = 2) = P(Demand = 3) = P(Demand = 4) = 1 9 2 9 3 9 2 9 1 9 Analyzing demand across 30 days is challenging. Demand across multiple periods We are often interested in demand across multiple periods. For example, we want to know the number of patients in a month. Suppose daily demand is normally distributed with mean 100 and variance 200. Demand across 30 days is also normally distributed with: mean: 30 × 100 = 3000 and variance 30 × 200 = 6000 More generally, if daily demand is normally distributed with mean 𝜇𝜇 and variance 𝜎𝜎 2 , then demand across 𝑘𝑘 days is also normally distributed with mean 𝑘𝑘𝑘𝑘 and variance 𝑘𝑘𝜎𝜎 2 . The above assumes daily demand is independent. Distribution fitting The normal distribution is defined by its mean and variance. Hence we estimate these values from the data available. Suppose the following 12 demand data are available: 85, 55, 150, 93, 65, 197, 54, 84, 116, 70, 54 and 69. Estimated 𝜇𝜇 = Estimated 𝜎𝜎 2 = 85+55+⋯+69 12 = 91 85−91 2 + 55−91 2 +⋯+ 69−91 2 12−1 = 1915.1 Q30 Distribution fitting Suppose the following 12 demand data are available: 85, 55, 150, 93, 65, 197, 54, 84, 116, 70, 54 and 69. Demand is modelled using a normal distribution defined by the estimated mean and variance obtained (i.e., 91 and 1915.1) Under the above assumption: 𝑃𝑃 𝐷𝐷 ≤ 101 = 𝑃𝑃 𝑍𝑍 ≤ 101.5 − 91 1915.1 = 𝑃𝑃 𝑍𝑍 ≤ 0.24 = 0.59 Q30 Distribution fitting Suppose the following 12 demand data are available: 85, 55, 150, 93, 65, 197, 54, 84, 116, 70, 54 and 69. We estimate 𝑃𝑃 𝐷𝐷 ≤ 101 by assuming that demand is normally distributed with mean 91 and variance 1915.1. Next, we check if this assumption is reasonable. If the assumption is true: ◦ 𝑃𝑃 Demand ≤ 91 = 𝑃𝑃 𝑍𝑍 ≤ 91.5−91 1915.1 = 𝑃𝑃 𝑍𝑍 ≤ 0.0114 = 0.505 ◦ 𝑃𝑃 Demand > 91 = 1 − 𝑃𝑃 Demand ≤ 91 = 0.495 Distribution fitting Assumption may not be reasonable Suppose the following 12 demand data are available: 85, 55, 150, 93, 65, 197, 54, 84, 116, 70, 54 and 69. We estimate 𝑃𝑃 𝐷𝐷 ≤ 101 by assuming that demand is normally distributed with mean 91 and variance 1915.1. Q31-37 Next, we check if this assumption is reasonable. If the assumption is true: ◦ Expected observations ≤ 91 = 12 × 0.505 = 6.06 ◦ Expected observations > 91 = 12 × 0.495 = 5.94 Actual observations is 8 Actual observations is 4 Data transformation If data is not normally distributed, one can try to make the data “normal” by applying some transformation. Log transformation: Power transformation: 𝑌𝑌 = ln(𝑋𝑋) 𝑌𝑌 = 𝑋𝑋 𝜆𝜆 where 𝜆𝜆 ≠ 0 Commonly used 𝜆𝜆 values are: -3, -2, -1, -0.5, 0.5, 1, 2 and 3 Data transformation If data is not normally distributed, one can try to make the data “normal” by applying some transformation. Demand ln(Demand) 85 4.443 55 4.007 150 5.011 93 4.533 65 4.174 197 5.283 54 3.989 84 4.431 116 4.754 70 4.248 54 3.989 69 4.234 • Estimated mean = 4.443+4.007+⋯+4.234 12 • 6 data points are above 4.425 = 4.425 • 6 data points are below 4.425 • Data appears to fits the properties of the normal distribution better after transformation. Q38-39 Data transformation If data is not normally distributed, one can try to make the data “normal” by applying some transformation. Demand ln(Demand) 85 4.443 55 4.007 150 5.011 93 4.533 65 4.174 197 5.283 54 3.989 84 4.431 116 4.754 70 4.248 54 3.989 69 4.234 Estimated mean = 4.443+4.007+⋯+4.234 12 Estimated variance = 0.171 𝑃𝑃 Demand ≤ 101 = 𝑃𝑃 𝑍𝑍 ≤ = 4.425 ln(101.5) − 4.425 = 𝑃𝑃 𝑍𝑍 ≤ 0.472 This probability estimate is better since ln(demand) is better = 0.68 described by the normal distribution. 0.171 Q40-43 Checking model fit Previously, we subjectively concluded that the fit is poor based on observations: ◦ At most 91: 8 (actual) versus 6.06 (expected) ◦ Greater than 91: 4 (actual) versus 5.94 (expected) The Pearson's chi-squared test (goodness-of-fit test) is a more objective way for assessing fit: 𝑘𝑘 observed𝑖𝑖 − expected𝑖𝑖 2 2 𝜒𝜒 = � expected𝑖𝑖 𝑖𝑖=1 where 𝑘𝑘 is the number of bins used. As a guide, expected𝑖𝑖 should be at least 5. Interested students can find out more about Pearson's chi-squared test here. For assessing normality, can use Shapiro-Wilk normality test. See online tool and description. Demand modeling procedure 1. Check data for normality. 2. If fit is poor, perform transformation to improve fit. 3. Estimate mean and variance from data. 4. Use estimated mean and variance to determine probabilities. Summary (demand modeling) Demand modeling Binomial distribution: n customers, each purchase with probability p. Poisson distribution: only average demand m is known. Normal distribution: average demand 𝜇𝜇 and demand variance 𝜎𝜎 2 are known. Advantages of modeling demand using the normal distribution: Uses information regarding average demand and demand variance Demand across multiple periods easy to analyze If modeling based on historical data, check if data is normally distributed. Data transformation should be used if data is not normally distributed. Inventory Models INVENTORY Newsvendor problem Suppose demand for newspaper in a given day is as follows: Demand Probability 20 0.2 21 0.2 22 0.2 23 0.2 24 0.2 Furthermore, each paper sells for $1.00 and the cost price of each paper is $0.30. How many papers should be ordered? Newsvendor problem Suppose we order 20 newspapers: 𝐸𝐸[Profit] = 0.2 $20 + $20 + $20 + $20 + $20 − 20 $0.3 = $14 Suppose we order 21 newspapers: 𝐸𝐸[Profit] = 0.2 $20 + $21 + $21 + $21 + $21 − 21 $0.3 = $14.5 Newsvendor problem Suppose we order 22 newspapers: 𝐸𝐸[Profit] = 0.2 $20 + $21 + $22 + $22 + $22 − 22 $0.3 = $14.8 Suppose we order 23 newspapers: 𝐸𝐸[Profit] = 0.2 $20 + $21 + $22 + $23 + $23 − 23 $0.3 = $14.9 Suppose we order 24 newspapers: highest expected profit 𝐸𝐸[Profit] = 0.2 $20 + $21 + $22 + $23 + $24 − 24 $0.3 = $14.8 Q1-6 Newsvendor solution Optimal order quantity: 𝑄𝑄 ∗ = max 𝑄𝑄: 𝑃𝑃 Demand ≥ 𝑄𝑄 ≥ Demand Probability 𝑃𝑃(𝐷𝐷 ≥ 𝑄𝑄) 20 0.2 1.0 21 0.2 0.8 22 0.2 0.6 cost price 23 0.2 0.4 24 0.2 0.2 Each paper sells for $1.00 and the cost price of each paper is $0.30. The optimal order quantity is 23. Q7-12 Newsvendor solution explained Suppose we order 20 newspapers: 𝐸𝐸[Profit] = 0.2 $20 + $20 + $20 + $20 + $20 − 20 $0.3 = $14 Suppose we order 21 newspapers: 𝐸𝐸[Profit] = 0.2 $20 + $21 + $21 + $21 + $21 − 21 $0.3 = $14.5 Benefit of ordering 21 instead of 20: $1 × 0.2 + 0.2 + 0.2 + 0.2 − 1 × $0.3 = $0.5 Newsvendor solution explained Benefit of ordering 21 instead of 20: 1 × 0.2 + 0.2 + 0.2 + 0.2 − 1 × 0.3 = 0.5 Benefit of ordering Q instead of Q – 1: price × 𝑃𝑃 Demand ≥ 𝑄𝑄 − cost ≥ 0 price × 𝑃𝑃 Demand ≥ 𝑄𝑄 ≥ cost 𝑃𝑃(Demand ≥ 𝑄𝑄) ≥ cost price Economic order quantity model EOQ model studies a simple multi-period inventory problem. Assumptions: ◦ ◦ ◦ ◦ ◦ ◦ Demand is deterministic and uniform over time Unit cost of each item is constant Ordering cost is constant Inventory holding cost is linear with respect to inventory Lead time is constant All demand must be satisfied, no stock-out allowed Economic order quantity model EOQ model studies a simple multi-period inventory problem. Inventory D: daily demand Q Q: order quantity L: lead time (in days) R=DL 𝑄𝑄 − 𝐿𝐿 𝐷𝐷 𝑄𝑄 𝐷𝐷 Time R: reorder point How much should we order? Q22-23 Costs in EOQ model Costs in EOQ model ◦ Holding cost: Cost for storage, insurance, opportunity cost ◦ Ordering cost: Cost of placing an order Q13-18 Objective: Minimize total cost (ordering + holding) 𝐷𝐷 𝑄𝑄 Ordering Cost = 𝐶𝐶 𝐶𝐶: Unit ordering cost Holding Cost = 𝐻𝐻 𝐻𝐻: Unit holding cost 𝑄𝑄 2 Costs in EOQ model Costs in EOQ model ◦ Holding cost: Cost for storage, insurance, opportunity cost ◦ Ordering cost: Cost of placing an order Objective: Minimize total cost (ordering + holding) 𝐷𝐷 𝑄𝑄 𝑇𝑇𝑇𝑇 = 𝐶𝐶 + 𝐻𝐻 𝑄𝑄 2 𝑑𝑑 −𝐷𝐷𝐷𝐷 𝐻𝐻 𝑇𝑇𝑇𝑇 = + 𝑑𝑑𝑑𝑑 𝑄𝑄 2 2 −𝐷𝐷𝐷𝐷 𝐻𝐻 + =0 𝑄𝑄 ∗ 2 2 𝑄𝑄∗ = 2𝐷𝐷𝐷𝐷 𝐻𝐻 Q19-20 EOQ model example C = $50 per order D = 365 per year H = $2.30 per year L = 5 days Find the optimal order quantity Q* and reorder point R: 𝑄𝑄∗ = 2𝐷𝐷𝐷𝐷 = 𝐻𝐻 𝑇𝑇𝐶𝐶125 = 𝑇𝑇𝐶𝐶126 2 × 365 × $50 = 125.97 units => 126 units $2.30 365 125 $50 + $2.30 = $289.75 2 125 365 126 = $50 + $2.30 = $289.74 2 126 lower total cost Q21 EOQ model example C = $50 per order D = 365 per year H = $2.30 per year L = 5 days Find the optimal order quantity Q* and reorder point R: What if D = 354 per year? 𝑅𝑅 = 𝐷𝐷𝐷𝐷 = 365 × 5 = 5 units 365 Q22-23 General inventory policy In practice, demand is uncertain and most products are not highly perishable. Here we discuss the multi-period inventory problem with uncertain demand. There are two parameters to determine: ◦ r: reorder point => when do we place an order ◦ Q: order quantity => how much do we order We study this first Order quantity, Q Suppose objective is to minimize total cost (ordering + holding): 𝑇𝑇𝑇𝑇 = 𝐷𝐷 𝑄𝑄 𝐶𝐶 + 𝐻𝐻 𝑄𝑄 2 𝑑𝑑 −𝐷𝐷𝐷𝐷 𝑇𝑇𝑇𝑇 = 𝑑𝑑𝑑𝑑 𝑄𝑄2 −𝐷𝐷𝐷𝐷 𝐻𝐻 =0 + 𝑄𝑄∗ 2 2 𝑄𝑄∗ = 2𝐷𝐷𝐷𝐷 𝐻𝐻 𝐸𝐸 𝑇𝑇𝑇𝑇 = Approximately true if demand is stationary 𝐸𝐸 𝐷𝐷 𝑄𝑄 𝐶𝐶 + 𝐻𝐻 𝑄𝑄 2 𝑑𝑑 −𝐸𝐸 𝐷𝐷 𝐶𝐶 𝐻𝐻 𝐸𝐸 𝑇𝑇𝑇𝑇 = + 𝑑𝑑𝑑𝑑 𝑄𝑄2 2 −𝐸𝐸 𝐷𝐷 𝐶𝐶 𝐻𝐻 =0 + 𝑄𝑄∗ 2 2 𝑄𝑄∗ = 2𝐸𝐸 𝐷𝐷 𝐶𝐶 𝐻𝐻 In practice, an approximate solution suffices. Order quantity, Q C = $50 per order 𝑄𝑄 ∗ = H = $2 per year = Daily demand ∼ N(100,1000) 2 × 𝐸𝐸 𝐷𝐷 × 𝐶𝐶 𝐻𝐻 2 × (365 × 100) × $50 $2 = 1350.9 𝑇𝑇𝑇𝑇1350 = 𝑇𝑇𝑇𝑇1351 = 365 × 100 1350 $50 + $2 = $2701.852 2 1350 365 × 100 1351 $50 + $2 = $2701.851 2 1351 𝑸𝑸∗ = 𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏 Reorder point, r Ideally, inventory should be zero when the next batch of goods arrives. When demand is deterministic, the reorder point is the inventory level that is sufficient to meet demand over the order lead time. When demand is uncertain, time when inventory hits zero is unclear. Low reorder point (too late): Delayed delivery High reorder point (too early): Positive inventory Reorder point, r NEWSVENDOR PROBLEM Q too low: loss sales REORDER POINT r too low: price – cost Q too high: wastage delay penalty, S r too high: positive inventory cost cost 𝑄𝑄∗ = max 𝑄𝑄: 𝑃𝑃 Demand ≥ 𝑄𝑄 ≥ price inventory holding cost, H H 𝑟𝑟 = max 𝑟𝑟: 𝑃𝑃 Demand ≥ 𝑟𝑟 ≥ H+S ∗ Reorder point, r What does it mean when a company’s inventory policy is such that: 𝑃𝑃 Demand ≥ 𝑟𝑟 = 0.05 It implies that: 𝐻𝐻 𝐻𝐻 + 𝑆𝑆 𝑆𝑆 ≈ 0.05 ⇒ ≈ 20 ⇒ ≈ 19 𝐻𝐻 + 𝑆𝑆 𝐻𝐻 𝐻𝐻 Delaying the delivery of one item to customer by one day cost 19 times more then the cost of keeping one item in inventory each day. Reorder point, r H = $2 per item per year S = $18 per item per year Daily demand ∼ N(100,1000) L = 5 days 𝑟𝑟 ∗ = max 𝑟𝑟: 𝑃𝑃 Demand ≥ 𝑟𝑟 ≥ = max 𝑟𝑟: 𝑃𝑃 Demand ≥ 𝑟𝑟 ≥ H H+S $2 $2+$18 = max 𝑟𝑟: 𝑃𝑃 Demand ≥ 𝑟𝑟 ≥ 0.1 = max 𝑟𝑟: 𝑃𝑃 Demand < 𝑟𝑟 ≤ 0.9 = max 𝑟𝑟: 𝑃𝑃 𝑍𝑍 ≤ = max 𝑟𝑟: 𝑟𝑟 − 0.5 − 5 × 100 5 × 1000 𝑟𝑟 − 0.5 − 5 × 100 5 × 1000 ≤ 1.28 = max 𝑟𝑟: 𝑟𝑟 ≤ 591.0097 ⇒ 𝟓𝟓𝟓𝟓𝟓𝟓 ≤ 0.9 Summary (inventory model) Newsvendor problem: Single period with uncertain demand Loss sales vs. wastage: 𝑄𝑄 ∗ = max 𝑄𝑄: 𝑃𝑃 Demand ≥ 𝑄𝑄 ≥ EOQ model: Multi-period with deterministic uniform demand Ordering cost vs. holding cost: 𝑄𝑄 ∗ = 2𝐷𝐷𝐷𝐷 𝑄𝑄 ∗ = 2×𝐸𝐸 𝐷𝐷 ×𝐶𝐶 and 𝐻𝐻 cost price 𝑅𝑅 = 𝐷𝐷𝐷𝐷 Multi-period with uncertain demand Ordering cost vs. “regular” holding cost: Delay cost vs. “excess” holding cost: 𝐻𝐻 𝑟𝑟 ∗ = max 𝑟𝑟: 𝑃𝑃 Demand ≥ 𝑟𝑟 ≥ H H+S Factory dynamics The next 3 weeks will be online learning. It is assumed that you have some mathematics, probability, statistics and MS Excel background. For students lacking the necessary background, the following videos might be useful: ◦ ◦ ◦ ◦ ◦ MS Excel: Relative and absolute cell references Uniform distribution Exponential distribution Sample variance Finding inverse of a function FD-EXP (Week 7 E-Learning).xlsx is available for download from LumiNUS. The next lecture is on 12 Mar 2020.