Annoying JuMP way to deal with shadow prices

JuMP has annoying shadow price behavior. First raised here, the issue also matters in the presence of non-linear models/constraints in JuMP.

The behavior is not there in GAMS. My model is an economic growth model. Took me a while to actually figure out what was going on—kind of annoying as I could have saved time, had I worked right away in GAMS. But I love JuMP/Julia and the flexibility it offers.

I had to re-program everything in GAMS and also derive the complementarity problem to be sure I was not making errors.

Moreover, “JuMP. shadow_price” does not work with “NLconstraint”, which are the bread and butter of economic modelling. So the solution suggested in that thread wont help.

I do not want to come off as ungrateful since I cannot do the great work that is being done and has been done with JuMP. But it would be great to address this issue once and for all. This is likely to affect new users.

I see three ways out. 1) make shadow_price work with nonlinear constraints, 2) have JuMP be consistent with GAMS/AMPL—may be by first checking if the problem is Max/Min and the multiplying duals/shadow_prices by -1 for Max. 3) Make it more explicit in the manual what is actually being done by JuMP.dual, inorder for one to back out the proper shadow prices.

Thanks

1 Like

It’s probably less effort to implement shadow_price for nonlinear constraints in JuMP than to re-write a model in GAMS, sorry you had to do that. Have a look at the code. We’re happy to review PRs and answer questions.

5 Likes

@miles.lubin thanks for the response. I am new to Julia/JuMP, but in any case will look at the code and try to place PR.

1 Like