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

Creating hierarchy out of ‘n’ categorical columns

Here is an R snippet that helps converting a data frame with multiple columns into a hierarchical format. In the below image, the right hand side table is the output achieved with the rootify function which uses the left hand side table... Continue →