Keywords: stochastic programming, risk, linear programming, python
Users of stochastic programming sometimes look only at "expected" payoff and ignore risk. For example, a well-known tutorial problem, Dakota furniture from Higle 2005, gives a max-expected profit $ 1730, but with 30 % chance of $ 650 loss, 70 % $2750 profit. That looks risky to me (an engineer, not a businessman).
It's easy to run SP for less risk: constrain profit to be >= for example $ 0, no loss. 4 runs of Dakota LP with constraints None, $ 0, $ 500, and $ 1000 give this table of profit when demand is low, medium or high:
low medium high demand
30 40 30 % probability
------------------------------------------------------
profit $ [-650 2750 2750] average $ 1730 cost $ 6450 -- Higle
profit $ [ 0 2415 2415] average $ 1691 cost $ 5800 -- constrain profit >= $ 0
profit $ [ 500 1902 1902] average $ 1481 cost $ 4581 -- constrain profit >= $ 500
profit $ [1000 1342 1342] average $ 1240 cost $ 3234 -- constrain profit >= $ 1000
------------------------------------------------------
- don't optimize expected payoff alone, look at risk too
- Dakota is only one (1) textbook problem; I'd appreciate links to more.
Dakota furniture makes desks, tables and chairs on a monthly schedule, as follows:
- on the 1st of each month, buy lumber etc. (3 resources) for the whole month
- then get a forecast whether demand for the month will be low, medium or high. Based on that, decide how many desks, how many tables, and how many chairs to make and sell over the month. Desks sell for $60, tables $40, chairs $10. There are resource limits: Dakota bought only so much lumber etc. on the 1st.
(Of course, this model is unrealistically simple, but.)
The "recourse" stochastic programming solution on Higle p. 36 is:
buy lumber etc. on each 1st for $1300 + $540 + $325, then make
Desks Tables Chairs Profit
------------------------------
low: 50 20 200 $ -650 (loss)
medium: 80 110 0 $ 2750
high: 80 110 0 $ 2750
(The general problem of stochastic programming is to decide what and how much to buy now, to meet uncertain demand over the next say 7 days or 30 days or 12 months. Examples: chain store inventory, cars, buildings. There are many approaches to such a range of problems, with subcultures who think differently: business, finance, optimization ...)
dakota_abc.py
: build LP matrices A b c
in numpy or scipy.sparse format
dakota.py
: solve with
scipy linprog interior-point
(Run python dakota.py T=2
to see the structure of A
.)
The parameter T=
builds larger matrices, 3T+1 x 3T+3, for T
time periods.
But there's no coupling between time periods, so solutions are independent of T
.
There are many papers on Benders etc. decomposition schemes
that claim to speed up big stochastic-programming LPs.
How do these compare with sparse interior-point linprog
,
on other opensource problems on the web ?
Higle 2005, "Stochastic Programming: Optimization When Uncertainty Matters", 24 pages,
pdf
Wikipedia Stochastic programming
github.com/topics/stochastic-optimization
splib test cases -- rather a tangle
cheers
-- denis 29 May 2019
Theory and practice are closer in theory than they are in practice.