0% found this document useful (0 votes)
78 views

Lecture2 PDF

1. The document summarizes a lecture on stochastic programming modeling. It discusses grading policies, survey results from students, and outlines different approaches to dealing with randomness in linear programs including guessing values, using chance constraints, and penalizing shortfalls. 2. It also provides an example of a farmer problem as a recourse model where the farmer can take corrective actions like purchasing or selling crops depending on the weather outcomes.

Uploaded by

Usman HamId
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
78 views

Lecture2 PDF

1. The document summarizes a lecture on stochastic programming modeling. It discusses grading policies, survey results from students, and outlines different approaches to dealing with randomness in linear programs including guessing values, using chance constraints, and penalizing shortfalls. 2. It also provides an example of a farmer problem as a recourse model where the farmer can take corrective actions like purchasing or selling crops depending on the weather outcomes.

Uploaded by

Usman HamId
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 42

IE 495 – Lecture 2

Stochastic Programming Modeling

Prof. Jeff Linderoth

January 15, 2003


Grading Policy

I forgot to add my grading policy for this semester on the syllabus...


• I will use a “sampling-based” grading scheme.
• For the assigned problems, I will grade one (maybe two)
problems in-depth.
¦ These problems will be out of 7 points.
¦ The remaining problems will be worth 3 points.
? I will always produce a full set of solutions.
Bueller? Bueller? Anyone?

Survey results...
• Happy: Most people want to do a project.
¦ Some people even want to do both!
• Sad: Less than half have taken Nonlinear Programming.
¦ That’s OK, we’ll introduce/review as needed
• Some people don’t want much theory. Tough Toenails!
Today’s Outline

• Review
• Stages and Decisions in Stochastic Programs
¦ Wait-and-see vs. Here-and-now
• Dealing with Randomness in Linear Programs
¦ Guess
– Risk aversion
¦ Chance constraints
¦ Penalize shortages
¦ Recourse actions
• Farmer Ted – A recourse problem
Please don’t call on me!

• What does the term programming mean in stochastic


programming?
• What is the expected value of (positive-valued) discrete
random variable ξ?
• What is a probability space?
¦ Do you care what a probability space is?
A Random Linear Program

minimize
x1 + x2
subject to

ω1 x1 + x2 ≥ 7
ω2 x1 + x2 ≥ 4
x1 ≥ 0
x2 ≥ 0

• ω1 ∼ U[1, 4]
• ω2 ∼ U[1/3, 1]
Worth 1000 Words?
What To Do?

• How do we solve this problem?


• What do you mean by solving this problem?
• Suppose it is possible to decide about x after the observation of
the random vector ω?
¦ We can interpret this as a wait-and-see approach
• Can we solve the problem then?
¦ I sure the heck hope so – it’s just a simple deterministic
linear program!
Here and Now

• Generally, “wait-and-see” is not an appropriate model of how


things work.
⇒ We need to decide on x before knowing the values of ω.
• In order for the problem to make sense in this case, we need to
decide what to do about not knowing ω1 , ω2 .
• Three suggestions
¦ Guess at uncertainty
¦ Probabilistic Constraints
¦ Penalize Shortfall
Guess Away!

• We will guess reasonable values for ω1 , ω2


¦ Like I mentioned last lecture, this is what people normally
do.
¦ What should be guess?
• I will offer three (reasonable) suggestions – each of which tells
us something about our level of “risk”
¦ Unbiased: Choose mean values for each random variable
¦ Pessimistic: Choose worst case values for ω
¦ Optimistic: Choose best case values for ω
Unbiased

• ω̂ ≡ E(ω) = (5/2, 3/2)


minimize

x1 + x2

subject to
5
x1 + x2 ≥ 7
2
3
x1 + x2 ≥ 4
2
x1 , x2 ≥ 0

• v̂ = 50/11
• (x̂1 , x̂2 ) = (18/11, 32/11)
Pessimistic

• ω̂ = (1, 1/3)
minimize

x1 + x2

subject to

1x1 + x2 ≥ 7
1/3x1 + x2 ≥ 4
x1 , x2 ≥ 0
Picture...

• v̂ = 7
• (x̂1 , x̂2 ) = (0, 7)
Optimistic

• ω̂ = (4, 1)
minimize

x1 + x2

subject to

4x1 + x2 ≥ 7
1x1 + x2 ≥ 4
x1 , x2 ≥ 0

• v̂ = 4
• (x̂1 , x̂2 ) = (4, 0)
Pros and Cons

+ Easy!
¦ Solve a deterministic problem oif the same size as the
original random problem
+ Only “rough” information about the randomness ω is needed.
– Only takes into account one “case” of what the randomness
might be
– There might even be ω for which the chosen x is infeasible.
Chance Constrained

• Another (probably more reasonable) approach. Let’s enforce


that the probability of a constraint holding is sufficiently large.
Let’s add the constraints

P{ω1 x1 + x2 ≥ 7} ≥ α1
P{ω2 x1 + x2 ≥ 4} ≥ α2

Or maybe the constraint

P{ω1 x1 + x2 ≥ 7, ω2 x1 + x2 ≥ 4} ≥ α
Chance Constraints

• Note for α1 , alpha2 , α = 1 this is equivalent to a normal


(deterministic) problem
? How do we solve probabilistically constrained problems?
– It’s (very) difficult
¦ Stay tuned.
⇒ We will learn (a little) bit about these problems later in
the course
Approach III – Penalize Shortfall

• We will accept infeasibility, but penalize the expected shortage.


• Notation:
¦ x+ ≡ max(0, z) : The positive part of z.
¦ x− ≡ max(0, −z) : The negative part of z.
• Then, for the constraint ω1 x1 + x2 ≥ 7, the shortfall is
(ω1 x1 + x2 ≥ 7)−
• For each constraint, assign (unit) shortfall costs q1 , q2 .
• Optimization problem becomes...
£ −
¤ £ −
¤
min2 {x1 +x2 +q1 Eω1 (ω1 x1 + x2 − 7) +q2 Eω2 (ω2 x1 + x2 − 4) }
x∈<+
Yikes!

• Yes, I concur that the function we are trying to optimize looks


ugly.
• However, it is convex.
¦ You will learn this formally later. (Yuck! Theory!)
• In fact, it is not too hard to see that the problem is equivalent
to the following:
   
  ω1 x1 + x2 + y1 ≥ 7  
min2 x1 + x2 + Eω  min2 q1 y1 + q2 y2 : 
x∈<+  y∈<+  ω2 x1 + x2 + y2 ≥ 4  
Recourse Function

• Let’s write the problem in terms of x only

min2 {x1 + x2 + Q(x1 , x2 )}


x∈<+

where
  
 y1 ≥ 7 − ω1 x1 − x2 
Q(x1 , x2 ) = Eω  min2 q1 y1 + q2 y2 : 
y∈<+  y2 ≥ 4 − ω2 x1 − x2 

• Q(x1 , x2 ) is called the recourse function.


• For a given decision x1 , x2 , what do we do (recourse)?
• In this case, it is simply to penalize the shortfall.
• y1 , y2 will be exactly the shortfall in constraints 1 and 2.
Decisions, Stages, and Recourse

When dealing with “here-and-now” decision problems, in general,


we don’t have to necessarily penalize shortfall, but we might be
able to take “corrective action” – recourse!
Consider a planning problem with two periods. The following
sequence of events occurs.
1. We make a decision now (first-period decision)
2. Nature makes a random decision (“stuff” happens)
3. We make a second period decision that attempts to repair the
havoc wrought by nature in (2). (recourse)
Recourse Example – Farmer Ted

• Farmer Ted can grow Wheat, Corn, or Beans on his 500 acres.
• Farmer Ted requires 200 tons of wheat and 240 tons of corn to
feed his cattle
¦ These can be grown on his land or bought from a wholesaler.
¦ Any production in excess of these amounts can be sold for
$170/ton (wheat) and $150/ton (corn)
¦ Any shortfall must be bought from the wholesaler at a cost
of $238/ton (wheat) and $210/ton (corn).
• Farmer Ted can also grow beans
¦ Beans sell at $36/ton for the first 6000 tons
¦ Due to economic quotas on beet production, beans in excess
of 6000 tons can only be sold at $10/ton
The Data

• 500 acres available for planting

Wheat Corn Beans


Yield (T/acre) 2.5 3 20
Planting Cost ($/acre) 150 230 260
Selling Price 170 150 36 (≤ 6000T)
10 (>6000T)
Purchase Price 238 210 N/A
Minimum Requirement 200 240 N/A
Formulate the LP – Decision Variables

• xW,C,B Acres of Wheat, Corn, Beans Planted


• wW,C,B Tons of Wheat, Corn, Beans sold (at favorable price).
• eB Tons of beans sold at lower price
• yW,C Tons of Wheat, Corn purchased.
? Note that Farmer Ted has recourse. After he observes the
weather event, he can decide how much of each crop to sell or
purchase!
• (Farmer Fred from lecture #1 had no recourse – his recourse
action was to simply count the profits).
Formulation

maximize

−150xW −230xC −260xB −238yW +170wW −210yC +150yC +36wB +10eB

subject to

xW + xC + xB ≤ 500
2.5xW + yW − wW = 200
3xC + yC − wC = 240
20xB − wB − eB = 0
wB ≤ 6000
xW , xC , xB , yW , yC , eB , wW , wC , wB ≥ 0
Solution with (expected) yields

Wheat Corn Beans


Plant (acres) 120 80 300
Production 300 240 6000
Sales 100 0 6000
Purchase 0 0 0

• Profit: $118,600
Planting Intuition

• Farmer Ted is happy to see that the LP solution corresponds to


his intuition.
¦ Plant the land necessary to grow up to his quota limit of
beans.
¦ Plant land necessary to meet his requirements for wheat
and corn
¦ Plant remaining land with wheat – sell excess.
It’s the Weather, Stupid!

• Farmer Ted knows well enough to know that his yields aren’t
always precisely Y = (2.5, 3, 20). He decides to run two more
scenarios
• Good weather: 1.2Y
• Bad weather: 0.8Y
Formulation – Good yields

maximize

−150xW −230xC −260xB −238yW +170wW −210yC +150yC +36wB +10eB

subject to

xW + xC + xB ≤ 500
3xW + yW − wW = 200
3.6xC + yC − wC = 240
24xB − wB − eB = 0
wB ≤ 6000
xW , xC , xB , yW , yC , eB , wW , wC , wB ≥ 0
Solution with good yields

Wheat Corn Beans


Plant (acres) 183.33 66.67 250
Production 550 240 6000
Sales 350 0 6000
Purchase 0 0 0

• Profit: $167,667
Formulation – Bad Yields

maximize

−150xW −230xC −260xB −238yW +170wW −210yC +150yC +36wB +10eB

subject to

xW + xC + xB ≤ 500
2xW + yW − wW = 200
2.4xC + yC − wC = 240
16xB − wB − eB = 0
wB ≤ 6000
xW , xC , xB , yW , yC , eB , wW , wC , wB ≥ 0
Solution – Bad Yields

Wheat Corn Beans


Plant (acres) 100 25 375
Production 200 60 6000
Sales 0 0 6000
Purchase 0 180 0

• Profit: $59,950
What to do?

• Obviously the answer is quite dependent on the weather and


the respective yields.
• Another main issue is on bean production. Without knowing
the weather/yield, he can’t determine the proper amount of
beans to plant to maximize his quota and not have to sell any
at the unfavorable price.
• It’s impossible to make a perfect decision, since planting
decisions must be made now, but purchase and sales decisions
can be made later.
Maximize Expected Profit

• Assume that the three scenarios occur with equal proability.


• Attach a scenario subscript s = 1, 2, 3 to each of the purchase
and sale variables.
¦ 1: Good, 2: Average, 3: Bad
Ex. wC2 : Tons of corn sold at favorable price in scenario 2
Ex. eB3 : Tons of beans sold at unfavorable price in scenario 3.
Expected Profit

• An expression for Farmer Ted’s Expected Profit is the


following:

150xW − 230xC − 260xB


+1/3(−238yW 1 + 170wW 1 − 210yC1 + 150yC1 + 36wB1 + 10eB1 )
+1/3(−238yW 2 + 170wW 2 − 210yC2 + 150yC2 + 36wB2 + 10eB2 )
+1/3(−238yW 3 + 170wW 3 − 210yC3 + 150yC3 + 36wB3 + 10eB3 )
Expected Value Problem – Constraints

xW + xC + xB ≤ 500
3xW + yW 1 − wW 1 = 200
2.5xW + yW 2 − wW 2 = 200
2xW + yW 3 − wW 3 = 200
3.6xC + yC1 − wC1 = 240
3xC + yC2 − wC2 = 240
2.4xC + yC3 − wC3 = 240
24xB − wB1 − eB1 = 0
20xB − wB2 − eB2 = 0
16xB − wB3 − eB3 = 0
wB1 , wB2 , wB3 ≤ 6000
All vars ≥ 0
Optimal Solution

Wheat Corn Beans


s Plant (acres) 170 80 250
1 Production 510 288 6000
1 Sales 310 48 6000
1 Purchase 0 0 0
2 Production 425 240 5000
2 Sales 225 0 5000
2 Purchase 0 0 0
3 Production 340 192 4000
3 Sales 140 0 4000
3 Purchase 0 48 0

• (Expected) Profit: $108,390


Solution Characteristics

• Best solution allocates land for beans to always avoid having to


sell them at the unfavorable price.
• Corn is planted so that the requirement is met in the average
scenario.
• The remaining land is allocated to wheat.
? Again, it is impossible to find a solution that is ideal under all
circumstances. Decisions in stochastic models are balanced, or
hedged against the various scenarios.
AMPL
Fortune Tellers

• Suppose Farmer Ted could with certainty tell whether or not


the upcoming growing season was going to have good yields,
average yields, or bad yields.
¦ His bursitits was acting up
¦ Consulting the Farmer’s Almanac
¦ Hire a fortune teller
• The real point here is how much Farmer Fred would be willing
to pay for this “perfect” information.
? In real-life problems, how much is it “worth” to invest in better
(or perfect) forecasting technology?
What’s it worth?

• If p = 0.5 – i.e. half of the seasons are wet, and half of the
seasons are dry, how much more money could he make?
• In the wet seasons, he would plant all corn and make $100.
• In the dry seasons, he would plant all wheat and make $40.
• In the long run, his profit would be 0.5(100) + 0.5(40) = $70.
• Constrast this to the optimal (in the presence of uncertainty)
profit of planting all beans : $57.5.
• We can this difference ($70 - $57.5) the expected value of
perfect information(EVPI)
What’s it worth?

• With perfect information, Farmer Ted’s would plant (wheat,


corn, beans).
¦ Good yield: (183.33, 66.67, 250), Profit: $167,667
¦ Average yield: (120, 80, 300), Profit: $118,600
¦ Bad yield: (100, 25, 375), Profit: $59,950
• Assuming each of these scenarios occurs with probability 1/3,
his long run average profit would be
¦ (1/3)(167667) + (1/3)(118600) + (1/3)(59950) = 115406
• With his (optimal) “here-and-now” decision of (170, 80, 250),
he would make a long run profit of 108390
• This difference (115406-108390) is the expected value of perfect
information(EVPI)
Readings

• 1.2, 2.1, 2.2, 2.3, 2.4, 2.7


• If you want to review some math – 2.9

You might also like