Lecture outline W.B.Powell 1

Similar documents
6.231 DYNAMIC PROGRAMMING LECTURE 8 LECTURE OUTLINE

Non-Deterministic Search

Lecture 17: More on Markov Decision Processes. Reinforcement learning

Lecture outline W.B. Powell 1

CS 188: Artificial Intelligence Spring Announcements

Handout 8: Introduction to Stochastic Dynamic Programming. 2 Examples of Stochastic Dynamic Programming Problems

Reinforcement Learning. Slides based on those used in Berkeley's AI class taught by Dan Klein

CS 188: Artificial Intelligence. Outline

CS 188: Artificial Intelligence

Dynamic Programming: An overview. 1 Preliminaries: The basic principle underlying dynamic programming

91.420/543: Artificial Intelligence UMass Lowell CS Fall 2010

CSE 473: Artificial Intelligence

Markov Decision Processes

Markov Decision Processes (MDPs) CS 486/686 Introduction to AI University of Waterloo

2D5362 Machine Learning

Markov Decision Process

Sequential Decision Making

Handout 4: Deterministic Systems and the Shortest Path Problem

CS 343: Artificial Intelligence

Introduction to Dynamic Programming

6.896 Topics in Algorithmic Game Theory February 10, Lecture 3

Progressive Hedging for Multi-stage Stochastic Optimization Problems

Lecture 12: MDP1. Victor R. Lesser. CMPSCI 683 Fall 2010

CS 188: Artificial Intelligence

Probabilistic Robotics: Probabilistic Planning and MDPs

CSEP 573: Artificial Intelligence

The exam is closed book, closed calculator, and closed notes except your three crib sheets.

Multi-armed bandit problems

Stochastic Optimal Control

Penalty Functions. The Premise Quadratic Loss Problems and Solutions

Introduction to Financial Mathematics

Robust Dual Dynamic Programming

CHAPTER 5: DYNAMIC PROGRAMMING

Agricultural and Applied Economics 637 Applied Econometrics II

Optimization Prof. A. Goswami Department of Mathematics Indian Institute of Technology, Kharagpur. Lecture - 18 PERT

SOLVING ROBUST SUPPLY CHAIN PROBLEMS

Complex Decisions. Sequential Decision Making

Decision making in the presence of uncertainty

Q1. [?? pts] Search Traces

Forecast Horizons for Production Planning with Stochastic Demand

Optimal energy management and stochastic decomposition

COS 445 Final. Due online Monday, May 21st at 11:59 pm. Please upload each problem as a separate file via MTA.

Reinforcement Learning

Fast Convergence of Regress-later Series Estimators

6.231 DYNAMIC PROGRAMMING LECTURE 10 LECTURE OUTLINE

Lecture 7: Bayesian approach to MAB - Gittins index

Lecture 5. 1 Online Learning. 1.1 Learning Setup (Perspective of Universe) CSCI699: Topics in Learning & Game Theory

Financial Optimization ISE 347/447. Lecture 15. Dr. Ted Ralphs

Advanced Operations Research Prof. G. Srinivasan Dept of Management Studies Indian Institute of Technology, Madras

Basic Framework. About this class. Rewards Over Time. [This lecture adapted from Sutton & Barto and Russell & Norvig]

Course notes for EE394V Restructured Electricity Markets: Locational Marginal Pricing

Monte Carlo Tree Search with Sampled Information Relaxation Dual Bounds

Machine Learning (CSE 446): Pratical issues: optimization and learning

CS360 Homework 14 Solution

MDPs and Value Iteration 2/20/17

Reasoning with Uncertainty

Making Decisions. CS 3793 Artificial Intelligence Making Decisions 1

Markov Decision Processes: Making Decision in the Presence of Uncertainty. (some of) R&N R&N

Optimization Methods. Lecture 16: Dynamic Programming

Problem Set 2: Answers

CS 461: Machine Learning Lecture 8

4 Reinforcement Learning Basic Algorithms

Is Greedy Coordinate Descent a Terrible Algorithm?

EE365: Risk Averse Control

Overview: Representation Techniques

Computational Finance Least Squares Monte Carlo

CPSC 540: Machine Learning

Introduction to Reinforcement Learning. MAL Seminar

Martingale Pricing Theory in Discrete-Time and Discrete-Space Models

EE266 Homework 5 Solutions

Optimization Models one variable optimization and multivariable optimization

From Discrete Time to Continuous Time Modeling

36106 Managerial Decision Modeling Monte Carlo Simulation in Excel: Part IV

Advanced Operations Research Prof. G. Srinivasan Department of Management Studies Indian Institute of Technology, Madras

A Branch-and-Price method for the Multiple-depot Vehicle and Crew Scheduling Problem

Lecture 10: The knapsack problem

Computational Finance. Computational Finance p. 1

Applications of Quantum Annealing in Computational Finance. Dr. Phil Goddard Head of Research, 1QBit D-Wave User Conference, Santa Fe, Sept.

Essays on Some Combinatorial Optimization Problems with Interval Data

ECON 459 Game Theory. Lecture Notes Auctions. Luca Anderlini Spring 2017

Pakes (1986): Patents as Options: Some Estimates of the Value of Holding European Patent Stocks

Randomization and Simplification. Ehud Kalai 1 and Eilon Solan 2,3. Abstract

Deterministic Dynamic Programming

IEOR E4004: Introduction to OR: Deterministic Models

TDT4171 Artificial Intelligence Methods

Lecture 12: Introduction to reasoning under uncertainty. Actions and Consequences

Asset-Liability Management

Reinforcement Learning (1): Discrete MDP, Value Iteration, Policy Iteration

Reinforcement Learning (1): Discrete MDP, Value Iteration, Policy Iteration

Dynamic Programming and Reinforcement Learning

Markov Decision Processes. Lirong Xia

ECS171: Machine Learning

MATH3075/3975 FINANCIAL MATHEMATICS TUTORIAL PROBLEMS

CSE 417 Dynamic Programming (pt 2) Look at the Last Element

6.231 DYNAMIC PROGRAMMING LECTURE 3 LECTURE OUTLINE

COMPARING NEURAL NETWORK AND REGRESSION MODELS IN ASSET PRICING MODEL WITH HETEROGENEOUS BELIEFS

Computer Vision Group Prof. Daniel Cremers. 7. Sequential Data

1 The EOQ and Extensions

Chapter 2 Linear programming... 2 Chapter 3 Simplex... 4 Chapter 4 Sensitivity Analysis and duality... 5 Chapter 5 Network... 8 Chapter 6 Integer

Dynamic Programming (DP) Massimo Paolucci University of Genova

Transcription:

Lecture outline What is a policy? Policy function approximations (PFAs) Cost function approximations (CFAs) alue function approximations (FAs) Lookahead policies Finding good policies Optimizing continuous parameters 2013 W.B.Powell 1

What is a policy? Last time, we saw a few examples of policies» Searching over a graph» Learning when to sell an asset A policy is any rule/function that maps a state to an action.» This is the reason why a state must be all the information you need to make a decision (now or in the future). Policies come in many forms, but these can be organized into major groups:» Policy function approximations (PFAs)» Policies based on cost function approximations (CFAs)» Policies based on value function approximations (FAs)» Lookahead policies 2013 W.B.Powell 2

What is a policy? 1) Policy function approximations (PFAs)» Lookup table Recharge the battery between 2am and 6am each morning, and discharge as needed.» Parameterized functions Recharge the battery when the price is below and discharge discharge when the price is above» Regression models X PFA ( S ) S S» Neural networks 2 t 0 1 t 2 t charge S t x t

What is a policy? 2) Cost function approximations (CFAs)» Take the action that maximizes contribution (or minimizes cost) for just the current time period: M X ( S ) arg max C( S, x ) t x t t» We can parameterize myopic policies with bonus and penalties to encourage good long-term behavior.» We may use a cost function approximation: CFA X ( S ) argmax C ( S, x ) t x t t t t The cost function approximation C ( St, xt ) may be designed to produce better long-run behaviors.

What is a policy? 3) alue function approximations (FAS)» Using the exact value function X ( S ) arg max C( S, x ) ( S ) FA t t x t t t 1 t 1 t This is how we solved the budgeting problem earlier.» Or by approximating the value function in some way: X ( S ) arg max C( S, x ) E ( S ) FA t t x t t t 1 t 1 t» This is what most people associate with approximate dynamic programming or reinforcement learning

What is a policy? Four fundamental classes of policies:» 4) Lookahead policies Plan over the next T periods, but implement only the action it tells you to do now. M X ( S ) argmax C( S, x ) t xt, xt1,..., xtt t' t' t' t This strategy assumes that we forecast a perfect future, and solve the resulting deterministic optimization problem. There are more advanced strategies that explicitly model uncertainty in the future, but this is for advanced research groups. T 2013 W.B.Powell 6

Lecture outline What is a policy? Policy function approximations (PFAs) Cost function approximations (CFAs) alue function approximations (FAs) Lookahead policies Finding good policies Optimizing continuous parameters 2013 W.B.Powell 7

Policy function approximations Lookup tables» When in discrete state S, take discrete action a (or x).» These are popular with Playing games (black jack,backgammon, Connect 4,..) Routing over graphs many others» Black jack State is cards that you are holding Actions Double down? Take a card/hold Let A ( S t ) be a proposed action for each state. This represents a policy. Fix the policy, and play the game many times. Estimate the probability of winning from each state while following this policy 2013 W.B.Powell 8

Policy function approximations Policy function approximation:» Parametric functions Example 1 Our pricing problem. Sell if the price exceeds a smoothed estimate by a specific margin X 1 if pt pt ( St ) 0 Otherwise We have to choose a parameter that determines how much the price has risen over the long run average Example 2 Inventory ordering policies Q St If St q X ( St ) 0 Otherwise Need to determine (Q,q) 2013 W.B.Powell 9

Policy function approximations In the presence of fixed order costs and under certain conditions (recall EOQ derivation), an optimal policy is to order up to a limit Q: Order periods Q Time 2013 W.B.Powell 10

Policy function approximations Optimizing a policy for battery arbitrage 2013 W.B.Powell 11

Policy function approximations We had to design a simple, implementable policy that did not cheat! 140.00 120.00 100.00 80.00 Withdraw Store 60.00 40.00 20.00 0.00 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 53 55 57 59 61 63 65 67 69 71 We need to search for the best values of the Store Withdraw parameters and. 2013 W.B.Powell 12

Lecture outline What is a policy? Policy function approximations (PFAs) Cost function approximations (CFAs) alue function approximations (FAs) Lookahead policies Finding good policies Optimizing continuous parameters 2013 W.B.Powell 13

Cost function approximation Myopic policy» Let Csx (, ) be the cost of being in state sand taking action x. For example, this could be the cost of traversing link ( i, j), we would choose the link with the lowest cost.»» In more complex situations, this means minimizing costs in one day, or month or year, ignoring the impact of decisions now on the future. We write this policy mathematically using: X( S ) arg min( ormax) C( S, x) t x t» Myopic policies can give silly results, but there are problems where it works perfectly well! 2013 W.B.Powell 14

Cost function approximation Simple examples:» Buying the cheapest laptop.» Taking the job that offers the highest salary.» In a medical emergency, choose the closest ambulance. 2013 W.B.Powell 15

Schneider National 2013 W.B.Powell Slide 16

2013 W.B.Powell Slide 17

Cost function approximation Assigning drivers to loads over time. Drivers Loads t t+1 t+2 2013 W.B.Powell 18

Cost function approximation Managing blood inventories 2013 W.B.Powell Slide 19

Cost function approximation Managing blood inventories over time Week 0 Week 1 Week 2 Week 3 S 0 x 0 Rˆ, Dˆ 1 1 S 1 x 1 Rˆ, Dˆ 2 2 S 2 x 2 S x 2 Rˆ, Dˆ 3 3 x S S 3 3 x 3 t=0 t=1 t=2 t=3 2013 W.B.Powell Slide 20

Cost function approximation Sometimes it is best to modify the cost function to obtain better performance over time» Rather than buy the cheapest laptop over the internet, you purchase it from Best Buy so you can get their service plan. A higher cost now may lower costs in the future. Purchase cost Service plan Adjusted cost Buy.com $495 None $495 Best Buy $575 Geek squad $474 Amazon.com $519 None $519 2013 W.B.Powell 21

Cost function approximation Original objective function Cost function approximation F dd c x d d F dd c x d d D c d Set of stores True purchase cost D Set of stores c c d d True purchase cost Modified cost = c Adjustment for service d The "policy" is captured by the adjustment. 2013 W.B.Powell 22

Cost function approximation Other adjustments:» Ambulance example Instead of choosing the closest ambulance, we may need to make an adjustment to discourage pulling ambulances from areas which have few alternatives. Ambulance A Ambulance B Busy area Less-busy area 2013 W.B.Powell 23

Lecture outline What is a policy? Policy function approximations (PFAs) Cost function approximations (CFAs) alue function approximations (FAs) Lookahead policies Finding good policies Optimizing continuous parameters 2013 W.B.Powell 24

alue function approximations Basic idea» Take an action, and identify the state that an action lands you in. The state of the chess board. The state of your resume from taking a job. A physical location when the action involves moving from one place to another. 2013 W.B.Powell 25

alue function approximations The previous post-decision state: trucker in Texas 2013 W.B.Powell 26

alue function approximations Pre-decision state: we see the demands $350 $300 $150 $450 2013 W.B.Powell 27

alue function approximations We use initial value function approximations 0 ( MN) 0 0 ( CO) 0 $350 0 ( NY) 0 0 ( CA) 0 $300 $150 $450 2013 W.B.Powell 28

alue function approximations and make our first choice: 1 x 0 ( MN) 0 0 ( CO) 0 $350 0 ( NY) 0 0 ( CA) 0 $300 $150 $450 2013 W.B.Powell 29

alue function approximations Update the value of being in Texas. 0 ( MN) 0 0 ( CO) 0 $350 0 ( NY) 0 0 ( CA) 0 $300 $150 $450 1 ( TX) 450 2013 W.B.Powell 30

alue function approximations Now move to the next state, sample new demands and make a new decision 0 ( MN) 0 0 ( CO) 0 $400 $180 0 ( NY) 0 0 ( CA) 0 $600 $125 1 ( TX) 450 2013 W.B.Powell 31

alue function approximations Update value of being in NY 0 ( MN) 0 0 ( CO) 0 $400 $180 0 ( NY) 600 0 ( CA) 0 $600 $125 1 ( TX) 450 2013 W.B.Powell 32

alue function approximations Move to California. 0 ( MN) 0 0 ( CA) 0 $200 0 ( CO) 0 $350 $400 $150 1 ( TX) 450 0 ( NY) 600 2013 W.B.Powell 33

alue function approximations Make decision to return to TX and update value of being in CA 0 ( MN) 0 0 ( CA) 800 $200 0 ( CO) 0 $350 $400 $150 1 ( TX) 450 0 ( NY) 500 2013 W.B.Powell 34

alue function approximations Back in TX, we repeat the process, observing a different set of demands. 0 ( MN) 0 0 ( CO) 0 $385 0 ( NY) 500 0 ( CA) 800 $275 $800 $125 1 ( TX) 450 2013 W.B.Powell 35

alue function approximations We get a different decision and a new estimate of the value of being in TX 0 ( MN) 0 0 ( CO) 0 $385 0 ( NY) 500 0 ( CA) 800 $275 $800 $125 1 ( TX) 450 2013 W.B.Powell 36

alue function approximations Updating the value function: Old value: 1 ( TX) $450 New estimate: 2 ˆ ( ) $800 v TX How do we merge old with new? ( ) (1 ) ( ) ( ) ˆ ( ) 2 1 2 TX TX v TX (0.90)$450+(0.10)$800 $485 2013 W.B.Powell 37

alue function approximations An updated value of being in TX 0 ( MN) 0 0 ( CO) 0 $385 0 ( NY) 600 0 ( CA) 800 $275 $800 $125 1 ( TX) 485 2013 W.B.Powell 38

alue function approximation Notes:» At each step, our truck driver makes a decision based on previously computed estimates of the value of being in each location.» Using these value function approximations, decisions which capture (approximately) downstream impacts become quite easy.» But you have to trust the quality of your approximation.» There is an entire field of research that focuses on how to approximate value functions known as approximate dynamic programming. 2013 W.B.Powell 39

Lecture outline What is a policy? Policy function approximations (PFAs) Cost function approximations (CFAs) alue function approximations (FAs) Lookahead policies Finding good policies Optimizing continuous parameters 2013 W.B.Powell 40

Lookahead policies It is common to peek into the future: 2013 W.B.Powell 41

Lookahead policies Shortest path problems» Solve shortest path to destination to figure out the next step. We solve the shortest path using a point estimate of the future.» As car advances, Google updates traffic estimations (or you may react to traffic as you see it).» As the situation changes, we recalculate the shortest path to find an updated route. 2013 W.B.Powell 42

Lookahead policies Decision trees Schedule game Cancel game Forecast rain.1» A form of lookup table representation Schedule game Forecast cloudy.3 Square nodes Make a decision Cancel game Forecast sunny.6 Use weather report Circles Outcome nodes Represents state-action pairs Schedule game Cancel game Schedule game Do not use weather report Cancel game» Solving decision trees means finding the value at each outcome node. $2400 -$200 2013 W.B.Powell 43 -$1400 -$200 $2300 -$200 $3500 -$200

Action State Information State Action Rain.2 -$2000 Clouds.3 $1000 Sun.5 $5000 Rain.2 -$200 Clouds.3 -$200 Sun.5 -$200 Information Rain.8 -$2000 Clouds.2 $1000 Sun.0 $5000 Rain.8 -$200 Clouds.2 -$200 Sun.0 -$200 Rain.1 -$2000 Clouds.5 $1000 Sun.4 $5000 Rain.1 -$200 Clouds.5 -$200 Sun.4 -$200 Rain.1 -$2000 Clouds.2 $1000 Sun.7 $5000 Rain.1 -$200 Clouds.2 -$200 Sun.7 -$200 - Decision nodes - Outcome nodes 2013 W.B.Powell 44

-$1400 -$200 $2300 -$200 $3500 -$200 $2400 -$200 2013 W.B.Powell 45

-$200 $2300 $3500 $2400 -$200 2013 W.B.Powell 46

$2770 Approximate value of being in this state After rolling back, we use the value at each node to make the best decision. This value captures the effect of all future information and decisions. $2400 2013 W.B.Powell 47

Lookahead policies Sometimes, our lookahead policy involves solving a linear program over multiple time periods: X ( S ) argmin c x c x t ti ti t' i t' i i t' t 1 i x, x,..., x t t1 tt T Optimizing into the future» This strategy requires that we pretend we know everything that will happen in the future, and then optimize deterministically. 2013 W.B.Powell 48

Lookahead policies We can handle vector-valued decisions by solving linear (or integer) programs over a horizon. 49

Lookahead policies We optimize into the future, but then ignore the decisions that would not be implemented until later. 50

Lookahead policies Assume that this is the full model (over T time periods) T 51

Lookahead policies But we solve a smaller lookahead model (from t to t+h) 0 0+H 52

Lookahead policies Following a lookahead policy 1 1+H 53

Lookahead policies which rolls forward in time. 2 2+H 54

Lookahead policies which rolls forward in time. 3 3+H 55

Lookahead policies which rolls forward in time. t t+h 56

Lookahead policies Notes on lookahead policies:» They construct the value of being in a state in the future on the fly, which allows the calculation to take into account many other variables (e.g. the status of the entire chess board).» Lookahead policies are brute force searching the tree of all possible outcomes and decisions can get expensive. Compute times grow exponentially with the length of the horizon.» But, they are simple to understand. 2013 W.B.Powell 57

Lecture outline What is a policy? Myopic cost function approximations Lookahead policies Policies based on value function approximations Policy function approximations Finding good policies Optimizing continuous parameters 2013 W.B.Powell 58

Finding good policies The process of searching for a good policy depends on the nature of the policy space:» 1) Small number of discrete policies» 2) Single, continuous parameter» 3) Two or more continuous parameters» 4) Finding the best of a subset». other more complicated stuff. 2013 W.B.Powell 59

Finding good policies Evaluating policies» We learned we can write our objective function as min EC S, ( ) t X St t ij We now have to deal with:» How do we design a policy? Choose the best type of policy (PFA, CFA, FA, Look-ahead, hybrid) Tune the parameters of the policy» How do we search for the best policy? 2013 W.B.Powell 60

Finding good policies Finding the best of two policies» We simulate a policy N times and take an average:» N 1 n F F ( ) N n1 If we simulate policies 1 and 2, we would like to conclude that is better than if F 1 2 F 1 2» How big should N be (or, is N big enough)? Have to compute confidence intervals. The variance of an estimate of the value of a policy is given by the usual formula: 1 1 N 2 n ( ) 2, s F F N N 1 n1 2013 W.B.Powell 61

Finding good policies Now construct confidence interval for the difference: 1 2» F F Point estimate of difference» Assume that the estimates of the value of each policy were performed independently. The variance of the difference is then s s s 2 2, 2, 1 2» Now construct a confidence interval around the difference: z s, z s /2 /2 2013 W.B.Powell 62

Finding good policies Better way:» Evaluate each policy using the same set of random variables (the same sample path)» Compute a sample realization of the difference: 1 2 ( ) F ( ) F ( ) 1 N s 2 N n1 n ( ) 1 1 N N 1 N n1 n ( ) 2 Now compute confidence interval in the usual way. 2013 W.B.Powell 63

Finding good policies Notes:» First method requires 2N simulations» Second method requires N simulations, but they have to be coordinated (e.g. run in parallel).» There is another method which further minimizes how many simulations are needed. Will describe this later in the course. 2013 W.B.Powell 64

Finding good policies We had to design a simple, implementable policy that did not cheat! 140.00 120.00 100.00 80.00 Withdraw Store 60.00 40.00 20.00 0.00 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 53 55 57 59 61 63 65 67 69 71 We need to search for the best values of the Store Withdraw parameters and. 2013 W.B.Powell 65

Finding good policies Finding the best policy ( policy search ) store withdraw» Let X ( S t, ) be the policy that chooses the actions.» We wish to maximize the function t min F(, W) C S, X ( S ) T t 0 t t Store Withdraw 2013 W.B.Powell 66

Finding good policies Illustration of policy search 2013 W.B.Powell 67

Finding good policies SMART-Solar» See http://energysystems.princeton.edu/smartfamily.htm Parameters that control the behavior of the policy. 2013 W.B.Powell 68

Finding good policies The control policy determines when the battery is charged or discharged. Energy level in the battery: Energy level in the battery:» Different values of the charge/discharge prices are simulated to determine which works the best. This is a form of policy search. 2013 W.B.Powell 69

Lecture outline What is a policy? Myopic cost function approximations Lookahead policies Policies based on value function approximations Policy function approximations Finding good policies Optimizing continuous parameters 2013 W.B.Powell 70

Optimizing continuous parameters The problem of finding the best policy can be written as a classic stochastic search problem: min E F ( x, W ) x» where x is a vector of continuous parameters» W represents all the random variables involved in evaluating a policy. 2013 W.B.Powell 71

Optimizing continuous parameters We can find x using a classic stochastic gradient algorithm» Let» Now assume that we can find the derivative with respect to each parameter in the policy (not always true). We would write this as» The stochastic gradient algorithm is then F( x) E F( x, W) gx (, ) FxW (, ( )) n n1 n1 n x x n 1 g( x, ) n x» We then use for iteration n+1 (for sample path ) n 2013 W.B.Powell 72

Optimizing continuous parameters Notes:» If we are maximizing, we use n n1 n1 n x x n 1 g( x, )» This algorithm is provably convergent if we use a stepsize such as 0 n n 1,2,... an1 0» Need to choose to solve the difference in units between the derivative and the parameters. 2013 W.B.Powell 73

Optimizing continuous parameters Computing a gradient generally requires some insight into the structure of the problem. An alternative is to use a finite difference. Assume that x is a scalar. We can find a gradient using gx (, ) Fx (, W( )) FxW (, ( ))» ery important: note that we are running the simulation twice using the same sample path. 2013 W.B.Powell 74