1

I am trying to write a small price optimization engine that optimizes revenues given a list of articles.

I have a list of articles and for each of them, I have its price elasticity of demand. My constraints are currently not defined, however, there will be definitely something putting a roof to the maximum price and the minimum price.

Currently, I am stuck in finding a way in which I could write down to the model the relationship of price and price elasticity, more precisely the model should have a constraint that understands that if an item is very elastic changing its price will affect a lot of quantity sold.

Moreover, I am actually not sure which kind of data I really need as input variables. Do I need something like a list of prices and quantity sold at different price points?

sanna
  • 1,398
  • 5
  • 16
  • 24

1 Answers1

2

I am afraid elasticities introduce nonlinearities in the model:

 log(Q) = C + Elasticity * log(P)

where C is a constant. Or stated differently:

  Q =  K * P^Elasticity 

where K = Exp(C) is again a constant.

These types of nonlinearities are typical in many economic models. They are often solved with non-linear solvers. PuLP is for linear models only, so if you want to use that you may want to use a linear approximation (i.e. a linear demand function). You probably should discuss this with your teacher or supervisor.

Erwin Kalvelagen
  • 15,677
  • 2
  • 14
  • 39
  • Thanks Erwin, alternatively, I might consider also using SciPy non-linear solvers: https://docs.scipy.org/doc/scipy/reference/optimize.nonlin.html would it be better? – sanna Jul 08 '20 at 15:29
  • These are not very sophisticated solvers, and the way to specify models is only suitable for small toy problems. I tend to stay away from them. I have never seen any serious economic model using these solvers. – Erwin Kalvelagen Jul 08 '20 at 15:32