Lecture outline W.B. Powell 1

Similar documents
Lecture outline W.B.Powell 1

Lesson Plan for Simulation with Spreadsheets (8/31/11 & 9/7/11)

36106 Managerial Decision Modeling Monte Carlo Simulation in Excel: Part IV

Inventory Analysis and Management. Single-Period Stochastic Models

Newsvendor Model OPRE 6302 Lecture Notes by Metin Çakanyıldırım Compiled at 14:04 on Friday 13 th November, 2015

Chapter Fourteen: Simulation

Characterization of the Optimum

Chapter 5. Continuous Random Variables and Probability Distributions. 5.1 Continuous Random Variables

IE652 - Chapter 6. Stochastic Inventory Models

Applications of Linear Programming

ECON 459 Game Theory. Lecture Notes Auctions. Luca Anderlini Spring 2017

Definition 4.1. In a stochastic process T is called a stopping time if you can tell when it happens.

MATH 10 INTRODUCTORY STATISTICS

CPSC 540: Machine Learning

EE266 Homework 5 Solutions

Advanced Operations Research Prof. G. Srinivasan Department of Management Studies Indian Institute of Technology, Madras

CPSC 540: Machine Learning

Scenario Generation and Sampling Methods

Gamma. The finite-difference formula for gamma is

IB Interview Guide: Case Study Exercises Three-Statement Modeling Case (30 Minutes)

A Simple Utility Approach to Private Equity Sales

Support Vector Machines: Training with Stochastic Gradient Descent

Lecture 8. The Binomial Distribution. Binomial Distribution. Binomial Distribution. Probability Distributions: Normal and Binomial

Reinforcement Learning. Slides based on those used in Berkeley's AI class taught by Dan Klein

6.041SC Probabilistic Systems Analysis and Applied Probability, Fall 2013 Transcript Lecture 23

The following content is provided under a Creative Commons license. Your support

CHAPTER 13: A PROFIT MAXIMIZING HARVEST SCHEDULING MODEL

Probability Theory and Simulation Methods. April 9th, Lecture 20: Special distributions

ECE 295: Lecture 03 Estimation and Confidence Interval

Eco504 Spring 2010 C. Sims FINAL EXAM. β t 1 2 φτ2 t subject to (1)

Real Estate Private Equity Case Study 3 Opportunistic Pre-Sold Apartment Development: Waterfall Returns Schedule, Part 1: Tier 1 IRRs and Cash Flows

Week 2 Quantitative Analysis of Financial Markets Hypothesis Testing and Confidence Intervals

Lecture 5. 1 Online Learning. 1.1 Learning Setup (Perspective of Universe) CSCI699: Topics in Learning & Game Theory

Economic optimization in Model Predictive Control

Final exam solutions

Problem Set 2: Answers

Using Monte Carlo Integration and Control Variates to Estimate π

A useful modeling tricks.

Pricing Barrier Options under Local Volatility

Babu Banarasi Das National Institute of Technology and Management

MAS187/AEF258. University of Newcastle upon Tyne

Homework Problems Stat 479

An Introduction to the Mathematics of Finance. Basu, Goodman, Stampfli

Chapter 3 - Lecture 5 The Binomial Probability Distribution

Outline. 1 Introduction. 2 Algorithms. 3 Examples. Algorithm 1 General coordinate minimization framework. 1: Choose x 0 R n and set k 0.

7. The random variable X is the number of cars entering the campus from 1 to 1:05 A.M. Assign probabilities according to the formula:

SIMULATION OF ELECTRICITY MARKETS

Department of Agricultural Economics. PhD Qualifier Examination. August 2010

THE UNIVERSITY OF THE WEST INDIES (DEPARTMENT OF MANAGEMENT STUDIES)

Uniform Probability Distribution. Continuous Random Variables &

Review. ESD.260 Fall 2003

Department of Mathematics. Mathematics of Financial Derivatives

Lecture 16: Risk Analysis II

Reinforcement Learning

Portfolio Management and Optimal Execution via Convex Optimization

EXERCISES FOR PRACTICE SESSION 2 OF STAT CAMP

CH 5 Normal Probability Distributions Properties of the Normal Distribution

CS 188 Fall Introduction to Artificial Intelligence Midterm 1. ˆ You have approximately 2 hours and 50 minutes.

Have you ever wondered whether it would be worth it to buy a lottery ticket every week, or pondered on questions such as If I were offered a choice

CD Appendix F Hypergeometric Distribution

Lecture 10. Ski Jacket Case Profit calculation Spreadsheet simulation Analysis of results Summary and Preparation for next class

Lecture 7: Bayesian approach to MAB - Gittins index

Exercise List: Proving convergence of the (Stochastic) Gradient Descent Method for the Least Squares Problem.

TTIC An Introduction to the Theory of Machine Learning. The Adversarial Multi-armed Bandit Problem Avrim Blum.

Markov Decision Processes: Making Decision in the Presence of Uncertainty. (some of) R&N R&N

TIM 206 Lecture Notes: Inventory Theory

Discrete Random Variables

Strategy -1- Strategy

Lecture Notes 1

INSTITUTE OF ACTUARIES OF INDIA EXAMINATIONS. 20 th May Subject CT3 Probability & Mathematical Statistics

6. Continous Distributions

Section 3.1: Discrete Event Simulation

CFE: Level 1 Exam Sample Questions

M.Sc. ACTUARIAL SCIENCE. Term-End Examination

Machine Learning (CSE 446): Pratical issues: optimization and learning

1 Online Problem Examples

Maximum Likelihood Estimates for Alpha and Beta With Zero SAIDI Days

CS 188: Artificial Intelligence

Learning Goals: * Determining the expected value from a probability distribution. * Applying the expected value formula to solve problems.

BINARY OPTIONS: A SMARTER WAY TO TRADE THE WORLD'S MARKETS NADEX.COM

Corporate Control. Itay Goldstein. Wharton School, University of Pennsylvania

Is Greedy Coordinate Descent a Terrible Algorithm?

Chapter 6 Continuous Probability Distributions. Learning objectives

Data Analysis and Statistical Methods Statistics 651

Probability Models.S2 Discrete Random Variables

SCHOOL OF BUSINESS, ECONOMICS AND MANAGEMENT. BF360 Operations Research

CS364B: Frontiers in Mechanism Design Lecture #18: Multi-Parameter Revenue-Maximization

CS 188: Artificial Intelligence

INSTITUTE AND FACULTY OF ACTUARIES SUMMARY

Statistical Methods in Practice STAT/MATH 3379

Problem set 1 Answers: 0 ( )= [ 0 ( +1 )] = [ ( +1 )]

HUDM4122 Probability and Statistical Inference. March 4, 2015

Optimal Dual-Sourcing: A Real Options Approach

Optimization 101. Dan dibartolomeo Webinar (from Boston) October 22, 2013

TDT4171 Artificial Intelligence Methods

The Optimization Process: An example of portfolio optimization

Problem # 2. In a country with a large population, the number of persons, N, that are HIV positive at time t is given by:

Decision Trees: Booths

2011 Pearson Education, Inc

2D5362 Machine Learning

Transcription:

Lecture outline Applications of the newsvendor problem The newsvendor problem Estimating the distribution and censored demands The newsvendor problem and risk The newsvendor problem with an unknown distribution 2013 W.B. Powell 1

2013 W.B. Powell 2

The newsvendor problem How large should your cash reserve be for redemptions?» Too big, and you have money that is underperforming.» Too small, and you may have to dump stocks at a reduced price. 2013 W.B. Powell 3

The newsvendor problem Water reservoirs can be used to balance the variability of energy from wind turbines. How much water should we store?» Too much, and we are storing energy now when we could be using it more productively (you lose energy when you store it).» Too little, and we may run out of water, which exposes us to the volatility of wind. 2013 W.B. Powell 4

The newsvendor problem Examples (physical):» How many jets should you order for your business jet fleet? Too many: have to pay for them when they are not being used. Too few: have to charter flights.» How fast should you drive? Too fast: risk of a ticket Too slow: takes a while to get there.» What should you sell your house for? Too high: takes a long time to sell. Too low: lose money on the deal. 2013 W.B. Powell 5

The newsvendor problem Examples (physical)» How many offers should J.P. Morgan make to ORFE students? Assume J.P. Morgan wants to hire 10 ORFE majors. After the first round of interviews, JPM may make 10 offers but get only six, after which they make additional offers. By the time they learn of the refusals, other students on their short list may have accepted offers from competing companies. JPM could make 14 offers and hope to get 10. If more than 10 accept, JPM has to create additional jobs. If less than 10 accept, JPM may be losing people to different companies. 2013 W.B. Powell 6

The newsvendor problem Examples (financial)» You are starting a new company. You have to raise initial capital to get the company started. You never know exactly how much you will need before the company is profitable. If you raise too little, you have to raise additional capital (which is more expensive) or risk the company. If you raise too much, then you have to pay for this.» Pricing an IPO: What if you price too high? What if you price too low? 2013 W.B. Powell 7

The newsvendor problem Examples (time)» You have to allocate time to finish a project. If you allocate too much time, then you have lost utilization of resources. If you allocate too little time, then you face the penalties of not finishing the project on time.» How many minutes should you commit to in your monthly cell phone plan? Too few: you pay the per minute cost of overage. Too much: you are paying for unused minutes.» How early to wake up to go the 9am class? 8am: likely to waste time waiting for class 8:45am: likely to arrive late 2013 W.B. Powell 8

The newsvendor problem The classic newsvendor problem (a.k.a. newsboy problem)» You have to decide how many newspapers to put in the newsstand at the beginning of the day.» At the end of the day you learn how many newspapers are left over. If you have any, you have to dispose of them (excess resource is assumed lost). Otherwise you may have lost demand. 2013 W.B. Powell 9

The newsvendor problem Essential elements:» Make a decision to allocate a resource of some form.» Later learn the demand for the resource.» Earn a net contribution from your decision.» Game ends. Observations:» The newsvendor problem is an elegant exercise in the study of sequencing information and decisions.» It is imbedded in almost all resource allocation problems. It is imbedded in decisions you make every day. In fact, you solved this problem when you decided when to leave to arrive to this class! 2013 W.B. Powell 10

The newsvendor problem Dimensions of a newsvendor problem» Repeatability: The one-shot version: no ability to learn from the result of an experiment. The repeated newsvendor problem» Time step (repeated version) Short e.g. daily Long update from one year to the next» Demand distribution Known (distribution known from exogenous sources) Unknown (depend on data as it is coming in)» Feedback We know how many resources were used. Imperfect information on resource utilization. 2013 W.B. Powell 11

Professor, As discussed briefly during the break in Saturday's class I am trying to apply the newsvendor inventory service level formula to optimize the level of cash that is held by my mutual fund in order to meet redemption requests from investors. Problem Mutual funds hold a certain percentage of their assets in cash in order to meet redemptions from investors. The exact amount is determined more as a guesstimate rather than systematically. I believe the problem is a variation of the Newsvendor problem discussed in class: Cost of shortfall: If not enough cash is held, the fund must sell some of its holdings and will experience transaction costs. These costs are deterministic and can be assumed to amount to 0.2% of the transaction volume. We can assume that there are no financing costs if there is a cash shortfall. Cost of excess cash [Ce ]: Holding to much cash leads to an opportunity cost of not participating in the market. Daily returns on the fund's portfolio are stochastic, and therefore I am not sure whether the Newsvendor formula we saw in class can be applied. The 'cost' of excess cash may even be a gain on some days when the portfolio is down. Complications I think reducing the problem to a Newsvendor problem is a good first approximation, but I see several complications: (i) There will be some correlation between the error term in the daily return on the portfolio and the probability function of getting redemptions. (ii) Reducing the problem to a single-period is a simplification for which I don't have a good feeling whether it is significant or not. (iii) The demand function is likely to be skewed by a few large redemptions. Although there is a large number of atomistic retail investors who would redeem small amounts each, a few large institutional investors might redeem large amounts at a time. (iv) The zero financing cost assumption does not apply for all redemptions, and in particular may not apply to large redemptions by institutions. Their redemptions proceeds need to be wired the following business day, while corresponding sales of portfolio securities take three business days to settle. However, small redemptions by retail investors are paid by check which take several days to mail and clear, by which time any securities sales will have settled. I would appreciate if you could point me to some literature that treats Ce as a stochastic variable. Maybe there is already a published solution to my problem (I'm not aware of any)? Thank you for your help. Regards, Part-time MBA student at the University of Chicago President & Portfolio Manager 2013 W.B. Powell 12

Lecture outline Applications of the newsvendor problem The newsvendor problem Estimating the distribution and censored demands The newsvendor problem and risk The newsvendor problem with an unknown distribution 2013 W.B. Powell 13

The newsvendor problem Let: Parameters c c o u Cost of overage (cost of ordering one unit too many) Cost of underage (cost of ordering one unit too few) Decision variables x Order quantity Activity variables D p Realization of random demand (assume it is continuous) Probability of an outcome o S Overage [ x D ] u S Underage [ D x] 2013 W.B. Powell 14

The newsvendor problem Objective function: o o u u F( x, ) c S ( x, ) c S ( x, ) u u o c [ xd ] c [ D x] F( x) E F( x, ) We want to solve: o [ ] [ ] c xd c D x p d min F( x) E F( x, ) x 2013 W.B. Powell 15

The newsvendor problem With just a couple assumptions (we will figure these out later), F( x) will look like: Continuous distribution Discrete distribution 2013 W.B. Powell 16

The newsvendor problem When the underlying random variable is continuous, the function F( x) is continuous. At the optimum, the gradient will equal to zero F x * ( ) 0 * x 2013 W.B. Powell 17

The newsvendor problem When the underlying random variable is discrete, the function F( x) is piecewise linear. At the break points, there is more than one gradient. * At x x, there will be one gradient equal to zero: * x F x * ( ) 0 2013 W.B. Powell 18

The newsvendor problem Let's say that we have found the optimal solution * (, ) 0 *. Normally, we could claim that the derivative of a function at the optimum would equal zero. But it will not generally be the case that: F x In fact, we may find that this is never true for any. But, we should find that: If: then: * E F( x, ) 0 u o F( x, ) c [ xd ] c [ D x] o * c if D x F( x, ) u c if D x * * x 2013 W.B. Powell 19

The newsvendor problem So: u t u F x D c D x c D x * o * * E (, ) Prob[ t ] Prob[ ] c D x c D x 0 o * * Prob[ t ] 1-Prob[ t ] t c c D x c o u * u Prob[ ] Rearranging gives us: c c u * Prob[ Dt x ] The "critical ratio" o u c 2013 W.B. Powell 20

The newsvendor problem 1.0 c o c u c u Prob(D<x) x * Order quantity x 2013 W.B. Powell 21

The newsvendor problem The profit maximizing version: Let: c Unit cost of purchasing product. p Price we sell our product for. x Quantity ordered. D Random demand for product Total conditional profits given demand D( ) : F( x, ) pmin x, D( ) cx Problem is to solve: max EF( x, ) E p min x, D cx x Now find the critical ratio... 2013 W.B. Powell 22

The newsvendor problem What cell phone plan should I use? 2013 W.B. Powell 23

The newsvendor problem Cost structure of my Verizon plan:» $0.14/minute of guaranteed time.» $0.45/minute if exceed guaranteed minimum.» Ex: 500 minutes per month $70 fixed monthly fee $0.45/minute over 500 minutes. 2013 W.B. Powell 24

The newsvendor problem Finding the optimal plan: Let: x Guaranteed minutes per month M =random variable giving minutes used per month. Objective function:??? min E.12 x.20 max( x,. M) x x 2013 W.B. Powell 25

The newsvendor problem Analysis: Stochastic gradient: * 0.14 M( ) x F( x, M( )) 0.31 M( ) x Find: F x M * E (, ( )) 0 M * *.14Prob( M( ) x ).31Prob( M( ) x ) * *.14Prob( ( ) ).31 1 Prob( ( ) ) M x M x * 0.310.45Prob( M ( ) x ) x * Prob( ( ) ) 0.31/ 0.45 0.70 I should exceed my minutes (roughly) 30 percent of the time. * * 2013 W.B. Powell 26

The newsvendor problem From past phone records, we can construct a histogram of the number of minutes used per month. 3.5 3 2.5 # of months 2 1.5 1 0.5 0 300 310 320 330 340 350 360 370 380 390 400 410 420 430 440 450 460 470 480 490 500 Minutes used 2013 W.B. Powell 27

`The newsvendor problem from which we can compute a cumulative distribution of minutes used. 1 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0 300 310 320 330 340 350 360 370 380 390 400 410 420 430 440 450 460 470 480 490 500 2013 W.B. Powell 28

The newsvendor problem Practical challenges in applying the newsvendor problem:» Estimating the probability distribution Use history from similar experiences Use judgment (This part is hardest with one-shot problems).» Estimating the cost of overage and underage Usually one of these two costs is soft Example: raising capital for startup:» Cost of raising too much: cost of capital» Cost of raising too little: need to estimate the cost of returning to the financial markets. 2013 W.B. Powell 29

The newsvendor problem Notes on solving newsvendor problems»do NOT memorize formulas for overage and underage.» Start by writing out the objective function.» Take the derivative with respect to the order quantity. You will usually find you obtain two values for the derivative one if you order too much, and one if you order too little.» Take the expectation of the gradient and set it equal to zero. Solve for the optimal order quantity in terms of the probability of being over or under. 2013 W.B. Powell 30

Lecture outline Applications of the newsvendor problem The newsvendor problem Estimating the distribution and censored demands The newsvendor problem and risk The newsvendor problem with an unknown distribution 2013 W.B. Powell 31

Censored demands Setup:» We make an allocation for period t.» Then learn requirement and compute cost.» Process repeats over and over. What do we do?» Use history to build probability distribution of demand» Update distribution periodically (e.g. after each observation).» Apply standard newsvendor logic. Challenge:» We typically cannot observe actual demand when we ordered too little. 2013 W.B. Powell 32

Censored demands Working with censored demands» In general, we estimate demand based on actual sales, rather than real demand.» This is often referred to as censored data. It means that we are not working with a complete dataset. 2013 W.B. Powell 33

Censored demands A naïve approach:» Estimate demand based on actual sales Let: t Dˆ ( ) t x 2 t t Order quantity at time t D ( ) Sample realization of demand at time t Observed demand We can estimate the mean and variance using observed demands: 1 t 1 Dˆ ( ) s min{ x, D ( )} t t t t t t 2 1 s Dˆ ( ) 2 t t1 t t1 t Set order quantity using: x t t 2013 W.B. Powell 34

Censored demands 35 Observed demand 30 25 Quantity 20 15 Observed demand 10 5 0 0 20 40 60 80 100 120 Time period 2013 W.B. Powell 35

Censored demands Actual demand and orders 35 30 25 Quantity 20 15 Order amt Actual demand 10 5 0 0 20 40 60 80 100 120 Time period 2013 W.B. Powell 36

Censored demands Alternative:» Use newsvendor concept: Let: s 2 t Estimate of the variance at time t Compute a smoothed estimate of the variance: 1 ˆ 1 1 ( ) s s x D 2 2 t t t t t t Set order quantity using: x z s 2 t t t Where z is chosen based on the newsvendor problem. 2 2013 W.B. Powell 37

Censored demands Product A orders 40 35 30 Order amount 25 20 15 Order amt Product A demand Estimate of mean 10 5 0 0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 Time period 60 64 68 72 76 80 84 88 92 96 100 Using Z = 0 2013 W.B. Powell 38

Censored demands Product A orders 40 35 30 Order amount 25 20 15 Order amt Product A demand Estimate of mean 10 5 0 0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 Time period 60 64 68 72 76 80 84 88 92 96 100 Using Z =.5 2013 W.B. Powell 39

Censored demands Product A orders 40 35 30 Order amount 25 20 15 Order amt Product A demand Estimate of mean 10 5 0 0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 Time period 60 64 68 72 76 80 84 88 92 96 100 Using Z =1.0 2013 W.B. Powell 40

Censored demands Notes:» Ordering extra quickly reduces the downward bias.» The price of this information is the cost of purchasing and holding additional product.» If the optimal solution is to cover a high percentage of demand, the error is small.» But if the optimal solution requires a significant amount of lost demand, you need to either: Periodically over order just to estimate the demand. Use specialized results that compensate for censored demands. 2013 W.B. Powell 41

Lecture outline Applications of the newsvendor problem The newsvendor problem Estimating the distribution and censored demands The newsvendor problem and risk The newsvendor problem with an unknown distribution 2013 W.B. Powell 42

Newsvendor and risk Using the optimal solution to the newsvendor problem can expose you to high levels of risk» Assume that the demand follows a Pareto distribution:» Moments: Mean: n 1 FD ( y) PD y y 0 2 1 2 y y For 1: X For 1: X 1 Variance: 2 For 2 : VarX For 2 : VarX 2013 W.B. Powell 43

Newsvendor and risk Let s see what happens when we choose parameters so that the mean and variance are infinite:» If we use =1, =1/2: 1/2 1 n 1 y 1 FD ( y) PD y y 0 y 1» We sample from this distribution using the relationship: 1 D FD ( U) where U is uniformly distributed between 0 and 1. So we can sample observations (in Excel) using: 1 D 2 (1 rand()) 2013 W.B. Powell 44

Newsvendor and risk Electricity spot prices Dollars per megawatt-hour Average price $50/megawatt-hour 2013 W.B. Powell 45

Newsvendor and risk Density: 2013 W.B. Powell 46

Newsvendor and risk Expected profits from newsvendor: x n p 1/2 n p min xd, cx y dy 10xP D x cx 2 y1 py px cx 1/2 x 1/2 y1 1/2 1/2 px p px cx 1/2 px p cx 2» The optimal order quantity is found by differentiating: p c 1/2 px c 0 x 2 2013 W.B. Powell 47

Newsvendor and risk Profits as a function of order quantity 1000 900 800 Expected profits per period 700 600 500 400 300 200 100 0 1 4 7 10 13 16 19 22 25 28 31 34 37 40 43 46 49 52 55 58 61 64 67 70 73 76 79 82 85 88 91 94 97 100 Order quantity 2013 W.B. Powell 48

Newsvendor and risk Let s use our optimal solution and see how well it does.» p=100»c=10» Optimal order quantity = 100 2013 W.B. Powell 49

Newsvendor and risk Order quantity = 100 2013 W.B. Powell 50

Newsvendor and risk Order quantity = 100 2013 W.B. Powell 51

Newsvendor and risk Order quantity = 100 2013 W.B. Powell 52

Newsvendor and risk Order quantity = 100 2013 W.B. Powell 53

Newsvendor and risk Observations:» On average, we are doing well.» But there are frequently sample paths where we lose a lot of money.» The problem is that our order quantity is too high we are chasing the possibility that the demands might be quite high.» Long stretches of low demand produce large losses.» What if we try a lower order quantity? 2013 W.B. Powell 54

Newsvendor and risk Order quantity = 50 2013 W.B. Powell 55

Newsvendor and risk Order quantity = 50 2013 W.B. Powell 56

Newsvendor and risk Order quantity = 25 2013 W.B. Powell 57

Newsvendor and risk Order quantity = 25 2013 W.B. Powell 58

Newsvendor and risk Observations» Smaller order quantities reduces profits, but reduces risk.» The correct order quantity depends on your startupcapital and tolerance for losses. 2013 W.B. Powell 59

Lecture outline Applications of the newsvendor problem The newsvendor problem Estimating the distribution and censored demands The newsvendor problem and risk The newsvendor problem with an unknown distribution 2013 W.B. Powell 60

Stochastic gradient algorithm A stochastic optimization problem involves a problem of the form: min E F( x, ) n1 n n1 n (, ) x (, ) (for the moment, assume the problem is unconstrained). A stochastic approximation procedure (or stochastic gradient algorithm) is an algorithm of the form: n n1 n n1 n x x g( x, ) where g() is a stochastic gradient, given by: Important variation: gradient smoothing: Then use: gx x n Fx g g g x n g, n n1 g, n n1 n (1 ) (, ) x g n 1 n n 2013 W.B. Powell 61

Stochastic gradient algorithm Applying this to the newsvendor problem: We start by writing: u o F( x, ) c [ xd ] c [ D x] Note that in our problem, an iteration n corresponds to a time period t, which we indicate as a subscript. This means that our stochastic gradient is: o c if xt 1 Dt gx ( t1, t ) u c if xt 1 Dt (Note that we have a tie-breaking problem if x can break this tie arbitrarily - we only require that g() be a valid subgradient - however, in the presence of censored demands...) t1 D ( ). We t 2013 W.B. Powell 62

Stochastic gradient algorithm Sample problem: D ~ U(0, 20) (Uniform distribution) t t t t u o Set the underage cost c 1 and the overage cost c 2. The optimal order quantity must satisfy 1/(1 2) of the demand. Since the demand distribution is uniform, that means the optimal order quantity is: u * c xt t 20 o u c c If the distribution of D is not known, the stochastic gradient algorithm is: 2 if x gx ( t1, t) 1 if x x x g( x, ) 1 t t1 t t t t t1 t1 D D t t 2013 W.B. Powell 63

Stochastic gradient algorithm Stepsize issues:» As with forecasting, we have to choose stepsizes that handle: Initialization problems Transient data Volatility» But we also have to handle scaling problems: The unit of the gradient is not the same as the unit of the order quantity. Scale the stepsize so that initially, the size of the adjustments being made are roughly 20 50 percent of the order quantity, and then let the stepsize decline from there. Use bigger initial stepsizes to increase adjustment from initial conditions; use smaller stepsizes to maintain stability. 2013 W.B. Powell 64

Stochastic gradient algorithm Constant stepsize:.2 25 20 15 10 Estimate Optimal 5 0 1 27 53 79 105 131 157 183 2013 W.B. Powell 65

Stochastic gradient algorithm Constant stepsize:.1 25 20 15 10 Estimate Optimal 5 0 1 26 51 76 101 126 151 176 201 2013 W.B. Powell 66

Stochastic gradient algorithm Constant stepsize:.05 25 20 15 10 Estimate Optimal 5 0 1 26 51 76 101 126 151 176 201 2013 W.B. Powell 67

Stochastic gradient algorithm Declining stepsize: 1/n (high initial estimate) 25 20 15 10 Estimate Optimal 5 0 1 26 51 76 101 126 151 176 201 2013 W.B. Powell 68

Stochastic gradient algorithm Declining stepsize: 5/(10+n) 25 20 15 10 Estimate Optimal 5 0 1 26 51 76 101 126 151 176 201 2013 W.B. Powell 69

Stochastic gradient algorithm The problem with declining stepsizes is when there are shifts: Stepsize =.05 25 20 15 10 Estimate Optimal 5 0 1 26 51 76 101 126 151 176 201 2013 W.B. Powell 70

Stochastic gradient algorithm The problem with declining stepsizes is when there are shifts: Stepsize =.10 25 20 15 10 Estimate Optimal 5 0 1 26 51 76 101 126 151 176 201 2013 W.B. Powell 71

Stochastic gradient algorithm The problem with declining stepsizes is when there are shifts: Stepsize =.20 25 20 15 10 Estimate Optimal 5 0 1 26 51 76 101 126 151 176 201 2013 W.B. Powell 72

Stochastic gradient algorithm The problem with declining stepsizes is when there are shifts: Stepsize = 1/n 25 20 15 10 Estimate Optimal 5 0 1 26 51 76 101 126 151 176 201 2013 W.B. Powell 73

Stochastic gradient algorithm The problem with declining stepsizes is when there are shifts: Stepsize = 5/(10+n) 25 20 15 10 Estimate Optimal 5 0 1 26 51 76 101 126 151 176 201 2013 W.B. Powell 74

Stochastic gradient algorithm Some observations:» We never assumed we knew anything about the demand distribution.» If we compute total profits, and compare them to what we would have obtained if we knew the demand distribution, we are almost always within 1.5 percent of the best we could achieve (without the benefit of hindsight). 2013 W.B. Powell 75

Stochastic gradient algorithm 1 100 Profits as of optimal Profits as a percent of optimal 0.99 Percent of optimal Percent of optimal 0.98 0.97 97 0.96 96 Series1 0.95 95 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Problem 2013 W.B. Powell 76