Computational Stochastic Optimization: Modeling October 25, 2012 Warren Powell CASTLE Laboratory...

30
Computational Stochastic Optimiz Modeling October 25, 2012 Warren Powell CASTLE Laboratory Princeton University http:// www.castlelab.princeton.edu © 2012 Warren B. Powell, Princeton University © 2012 Warren B. Powell

Transcript of Computational Stochastic Optimization: Modeling October 25, 2012 Warren Powell CASTLE Laboratory...

Computational Stochastic Optimization:Modeling

October 25, 2012

Warren PowellCASTLE Laboratory

Princeton Universityhttp://www.castlelab.princeton.edu

© 2012 Warren B. Powell, Princeton University © 2012 Warren B. Powell

Outline

Overview and major problem classes

How to model a sequential decision problem

Steps in the modeling process

Examples (underdevelopment)

© 2012 Warren B. Powell

3

Where to send a plane:

» Action: Where to send the plane to accomplish a goal.» Noise: demands on the system, equipment failures.

1 1( ) max ( , ) ( )t t a t t t tV S C S a EV S

Problem classes

© 2012 Warren B. Powell

4

Problem classes

How to land a plane:

» Control: angle, velocity, acceleration, pitch, yaw…» Noise: wind, measurement

1 1( ) max ( , ) ( )t t u t t t tV x C x u EV x

© 2012 Warren B. Powell

5

Problem classes

How to manage a fleet of planes

» Decision: Which plane to assign to each customer.» Noise: demands on the system, equipment failures.

1 1( ) max ( , ) ( )t t x t t t tV S C S x EV S © 2012 Warren B. Powell

Problem classes

These three problems illustrate three very different applications:» Managing a single entity, which can be represented

with a discrete action, typical of computer science.» Controlling a piece of machinery, which we model with

a multi-dimensional (but low dimensional) control vector.

» Managing large fleets of vehicles with high dimensional vectors (but exploiting convexity).

All three of these can be “modeled” using Bellman’s equation. Mathematically they look the same, but computationally they are very different.

© 2012 Warren B. Powell

Problem classes

Dimensions of our problem» Decisions

• Discrete actions• Multidimensional controls (without convexity)• High dimensional vectors (with convexity)

» Information stages• Single, deterministic decisions (or parameters), after which

random information is revealed to compute the cost.• Two-stage with recourse

– Make decision, see information, make one more decision• Fully sequential (multistage)

– Decision, information, decision, information, decision, …

» The objective function• Min/max expectation• Dynamic risk measures• Robust optimization

© 2012 Warren B. Powell

Problem classes

Our presentation focuses on sequential (also known as multistage) control problems.

We consider problems which involve sequences of decision, information, decision, information, …

There are important applications in stochastic optimization which belong to the first two classes of problems:» Decision/information» Decision/information/decision

We will also focus on problems which use an expectation for the objective function. There are many problems where risk is a major issue. We take the position that the objective function is part of the model.

© 2012 Warren B. Powell

Deterministic modeling

For deterministic problems, we speak the language of mathematical programming» For static problems

» For time-staged problems

min cx

0

Ax b

x

1 1

0

t t t t t

t t t

t

A x B x b

D x u

x

0

minT

t tt

c x

Arguably Dantzig’s biggest contribution, more so than the simplex algorithm, was his articulation of optimization problems in a standard format, which has given algorithmic researchers a common language.

© 2012 Warren B. Powell

Modeling as a Markov decision process

For stochastic problems, many people model the problem using Bellman’s equation

where

» This is the canonical form of a dynamic program building on Bellman’s seminal research. Simple, elegant, widely used but difficult to scale to realistic problems.

'

( ) min ( , ) ( ' | , ) ( ')as

V s C s a p s s a V s

"State variable"

Discrete action

( ' | , ) "Model" (transition matrix, transition kernel)

( ) Value of being in state

Discount factor

s

a

p s s a

V s s

© 2012 Warren B. Powell

Modeling as a stochastic program

A third strategy is to use the vocabulary of “stochastic programming”.» For “two-stage” stochastic programs

(decisions/information, or decisions/information/ decisions), this can be written in the generic form

or

where

min ( , )x F x WE

0 0 0 0 0 1min ( , )x X c x Q x E

1 10 1 ( ) ( ) 1 1( , ( )) min ( ) ( )x XQ x c x

© 2012 Warren B. Powell

Modeling as a stochastic program

In this talk, we will focus on multistage, sequential problems. Later in the presentation we show how the stochastic programming community models multistage, stochastic optimization problems.

We are going to show that (for sequential problems), dynamic programming and stochastic programming begin by providing a model of a sequential problem (which we refer to as a dynamic program).

However, we will show that stochastic programming (for sequential problems) is actually modeling what we will call the lookahead model (which is itself a dynamic program). This gives us what we will call a lookahead policy for solving dynamic programs.

© 2012 Warren B. Powell

Outline

Overview and major problem classes

How to model a sequential decision problem

Steps in the modeling process

Examples (underdevelopment)

© 2012 Warren B. Powell

Modeling

We lack a standard language for modeling sequential, stochastic decision problems.» In the slides that follow, we propose to model problems

along five fundamental dimensions:• State variables• Decision variables• Exogenous information processes• Transition function• Objective function

» This framework is widely followed in the control theory community, and almost completely ignored in operations research and computer science.

© 2012 Warren B. Powell

Slide 15

Modeling dynamic problems

The system state: , , System state, where:

Resource state (physical state)

Energy investments, energy storage, ...

Status of generators

Information state

t t t t

t

t

S R I K

R

I

State of the technology (costs, performance)

Market prices (oil, coal)

Knowledge state ("belief state")

Belief about the effect of CO2 on the environmtK

ent

Belief about the effect of fertilizer on algal blooms

The state variable is the minimally dimensioned function of

history that is necessary and sufficient to calculate the decision function, cost function and transition function.

© 2012 Warren B. Powell Slide 15

Slide 16

Modeling dynamic problems

The system state:

» The state variable is, without question, one of the most controversial concepts in stochastic optimization.

» A number of leading authors will either claim that it cannot be defined, or should not.

» We argue that students need to learn how to model a system properly, and the state variable is central to a proper model.

» Our definition insists that the state variable include all the information we need to make a decision (and only the information needed), now or in the future. We also feel that it should be “minimally dimensioned” which is to say, as simple and compact as possible.

» This means that all (properly modeled) dynamic systems are Markovian, eliminating the need for the concept of “history dependent” processes.

© 2012 Warren B. Powell Slide 16

Slide 17

Modeling dynamic problems

Decisions:Computer science

Discrete action

Control theory

Low-dimensional continuous vector

Operations research

Usually a discrete or continuous but high-dimensional

vector of dec

t

t

t

a

u

x

isions.

Classical notation is to define:

( ) Decision function (or "policy") mapping a state to an

an action , control or decision .

I prefer:

Let ( ) (or ( ) or ( )), where specifies the

s

a u x

A s X s U s

class of

policy, and any tunable parameters (which we represent using ).© 2012 Warren B. Powell Slide 17

Slide 18

Modeling dynamic problems

Exogenous information:

ˆ ˆ ˆ ˆNew information = , , ,

ˆ Exogenous changes in capacity, reserves

New gas/oil discoveries, breakthroughs in technology

ˆ New demands for energy from each source

t t t t t

t

t

W R D E p

R

D

Demand for energy

ˆ Changes in energy from wind and solar

ˆ Changes in prices of commodities, electricity, technologyt

t

E

p

Note: Any variable indexed by t is known at time t. This convention, which is not standard in control theory, dramatically simplifies the modeling of information.

© 2012 Warren B. Powell Slide 18

Slide 19

Modeling dynamic problems

The transition function

1 1

1 1

1 1

1 1

( , , )

ˆ Water in the reservoir

ˆ Spot prices

ˆ Energy from wind

Mt t t t

t t t t

t t t

Wind Wind Windt t t

S S S x W

R R Ax R

p p p

e e e

Also known as the:“System model”“State transition model”“Plant model”“Model”

© 2012 Warren B. Powell Slide 19

Stochastic optimization models

The objective function

Given a system model (transition function)

» We have to find the best policy, which is a function that maps states to feasible actions, using only the information available when the decision is made.

min , ( )tt t

t

E C S X S

Decision function (policy)State variableCost function

Finding the best policy

Expectation over allrandom outcomes

1 1, , ( )Mt t t tS S S x W

© 2012 Warren B. Powell

Objective functions

There are different objectives that we can use:» Expectations

» Risk measures

» Worst case (“robust optimization”)

min ( , )x F x WE

2min ( , ) ( , )

min ( , ) Convex/coherent risk measures

x

x

F x W F x W f

F x W

E E

r

min max ( , )x w F x W

© 2012 Warren B. Powell

Modeling

This framework (very familiar to the control theory community) offers a model for sequential decision problems (minimizing expected costs).

The most difficult hurdles involve:» Understanding (and properly modeling) the state variable.» Understanding what is meant (computationally) by the state

transition function. While very familiar to the control theory community, this is not a term used in operations research or computer science.

» Understanding what in the world is meant by “minimizing over policies.”

Finding computationally meaningful solution approaches involves entering what I have come to call the jungle of stochastic optimization.

© 2012 Warren B. Powell

Outline

Overview and major problem classes

How to model a sequential decision problem

Steps in the modeling process

Examples (underdevelopment)

© 2012 Warren B. Powell

Modeling stochastic optimization

In these slides, I am going to try to present a four-step process for modeling a sequential, stochastic system.

The approach begins by developing the idea of simulating a fixed policy. This is our model.

We then address the challenge of finding an effective policy.

The goal is to focus attention initially on modeling, after which we turn to the challenge of finding effective policies.

© 2012 Warren B. Powell

Modeling stochastic optimization

Step 1: » Start by modeling the problem deterministically:

» In this step, we focus on understanding decisions and costs.

0 ,...,0

( ) min ( , )T

T

x x t tt

F x C S x

© 2012 Warren B. Powell

Modeling stochastic optimization

Step 2: » Now imagine that the process is unfolding stochastically.

Every time you see a decision replace it with the decision function (policy) and take the expectation.

» Instead of maximizing over decisions, we are now maximizing over the types of policies for making a decision.

tx( )t tX S

0

min ( , ( ))T

t t tt

F C S X S

E

© 2012 Warren B. Powell

Stochastic optimization models

Step 3: » Now write out the objective function as a simulation. This

can be done as one long simulation:

» … or an average over multiple sample paths:

0

( ) ( ), ( )T

t t tt

F C S X S

1 0

1( ) ( ), ( )

n Tn n n

t t tn t

F p C S X SN

© 2012 Warren B. Powell

Stochastic optimization models

Step 4» Now search for the best policy:

• First choose a type of policy:– Myopic cost function approximation– Lookahead policy (deterministic, stochastic)– Policy function approximation– Policy based on a value function approximation– Or some sort of hybrid

• Then identify the tunable parameters of the policy • Tune the parameters

… using your favorite stochastic search or optimal learning algorithm.

• Loop over other types of policies.

0

min ( , ) ( ), ( ) |T

t t tt

F C S X S

© 2012 Warren B. Powell

Stochastic programming

Markov decision processes

Simulation optimization

Stochastic search

Reinforcement learning

Optimal control

Policy search

learningQ

Model predictive control

On-policy learning Off-policy learning

© 2012 Warren B. Powell

Computational Stochastic Optimization

Stochastic programming

Markov decision processes

Simulation optimization

Stochastic search

Reinforcement learningOptimal control

Policy search

learningQ

Model predictive control

On-policy learning

© 2012 Warren B. Powell