The News-Vendor Problem: Discrete Demand Case  

Last Sunday, I came across very interesting articles and applications of the News-vendor problem and decided to write R code to automate various cases of the same. Here is a start.

In the simplest category of the News-vendor problem, such as the one outlined in this article by Prof. Evan L. Porteus, the demand is assumed to be discrete. The professor explains how the optimal amount to be ordered is the one that yields the highest expected return, which can be calculated by marginal analysis.

Here is a snippet function written in R, that automates marginal analysis for the discrete demand case of the News-vendor problem:

Code1.png

Here is how Tyler’s data looks like:

data2.png

Let’s run this function for Tyler’s case and see what the output looks like.

output2.png

The optimal solution from the DiscreteNewsVendorA function gives the solution as expected!

Sanket

 
22
Kudos
 
22
Kudos

Now read this

Gradient Descent Algorithm for Linear Regression

For this exercise I will use the data-set from this blogpost and compare the results to those of the lm() function used to calculate the linear model coefficients therein. To understand the underlying math for the gradient descent... Continue →