Stochastic dynamic programming: Difference between revisions

From Cornell University Computational Optimization Open Textbook - Optimization Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 95: Line 95:
===Gamblling example===
===Gamblling example===
Consider an unfair coin flip game where the probability of the coin landing on heads is 0.6 and the probability of landing in tails is 0.4, and the game is each you flip head you win the amount you bet and each time you flip tails you lose the amount you bet as well. A gambler starts with 100$ dollar, cannot bet more money than he has and can play 10 games (the bet must be nonnegative). Our goal is to maximize his expected payout by using an optimal betting strategy. To find this we will use stochastic dynamic programming:
Consider an unfair coin flip game where the probability of the coin landing on heads is 0.6 and the probability of landing in tails is 0.4, and the game is each you flip head you win the amount you bet and each time you flip tails you lose the amount you bet as well. A gambler starts with 100$ dollar, cannot bet more money than he has and can play 10 games (the bet must be nonnegative). Our goal is to maximize his expected payout by using an optimal betting strategy. To find this we will use stochastic dynamic programming:
<math> V_n(x) = \max_{0<&alpha<1} \, \\{[0.6*V_n-1(x+&alpha*x)+0.4*V_n-1(x-&alpha*x)]}</math>


==Applications==
==Applications==

Revision as of 16:58, 25 November 2021

Authors: Bo Yuan, Ali Amadeh, Max Greenberg, Raquel Sarabia Soto and Claudia Valero De la Flor (CHEME/SYSEN 6800, Fall 2021)

Introduction

Theory, methodology and algorithm discussion

Theory

Stochastic dynamic programming combines stochastic programming and dynamic programming. Therefore, to understand better what it is, we give first two definitions:

  • Stochastic programming. Unlike in a deterministic problem, where a decision’s outcome is only determined by the decision itself and all the parameters are known, in stochastic programming there is uncertainty and the decision results in a distribution of transformations.
  • Dynamic programming. It is an optimization method that consists in dividing a complex problem into easier subprobems and solving them recursively to find the optimal sub-solutions which lead to the complex problem optima.

In any stochastic dynamic programming problem, we must define the following concepts:

  • Policy, which is the set of rules used to make a decision.
  • Initial vector, where and is a finite closed region.
  • Choice made, where and is a set of possible choices.
  • Stochastic vector, .
  • Distribution function , associated with and dependent on and .
  • Return, which is the expected value of the function after the final stage.

In a stochastic dynamic programming problem, we assume that is known after the decision of stage has been made and before the decision of stage has to be made.

Methodology and algorithm

First, we define the N-stage return obtained using the optimal policy and starting with vector :

      where  is the function of the final state 

Second, we define the initial transformation as , and , as the state resulting from it. The return after stages will be using the optimal policy. Therefore, we can formulate the expected return due to the initial choice made in :

  

Having defined that, the recurrence relation can be expressed as:

       

With:

  

This formulation presented is very general and depending on the problem characteristics, there have been developed different models. For this reason, we present the algorithm of two different models as examples: a finite stage-model and a model for Approximate Dynamic Programming (ADP).

Finite-stage model: a stock-option model

This model was created to maximize the expected profit that we can obtain in N days (stages) from selling/buying stocks. This is considered a finite-stage model because we know in advance for how many days are we calculating the expected profit.

First, we define the stock price on the th day as . We assume the following:

  

Where … are independent of and between them, and identically distributed with distribution .

Second, we also assume that we have the chance to buy a stock at a fixed price and this stock can be sold at price . We then define as the maximal expected profit, and it satisfies the following optimality equation:

  

And the boundary condition is the following:

  

Approximate Dynamic Programming (ADP)

Approximate dynamic programming (ADP) is an algorithm strategy for solving complex problems that can be stochastic. Since the topic of this page is Stochastic Dynamic Programming, we will discuss ADP from this perspective.

To develop the ADP algorithm, we present the Bellman’s equation using the expectation form.

      where  and 

The variables used and their meanings are the following:

  • State of the system,
  • Function . It represents the policy to make a decision
  • Transition function, . It describes the transition from state to state .
  • Action taken in state ,
  • Information observed after taking action ,
  • gives the expected value of being in state at time and making a decision following the optimal policy.

The goal of ADP is to replace the value of with a statistical approximation . Therefore, after iteration , we have an approximation . Another feature of ADP is that it steps forward in time. To go from one iteration to the following, we define our decision function as:

  

Next, we define as the value of that solves this problem and , as the estimate value of being in state :

  

Finally, using the approximation lookup table, is defined. In a lookup approximation, for each state we have a that gives an approximated value of being in .

        where  is known as a stepsize

Therefore, a generic ADP algorithm applied to stochastic dynamic programming can be summarized as:

1. We initialize for all states , and we choose an initial state and set .

2. For t=0,1,2.., we have to solve:

     
            if 
            if 
     

3. Set as long as .

Numerical examples

Gamblling example

Consider an unfair coin flip game where the probability of the coin landing on heads is 0.6 and the probability of landing in tails is 0.4, and the game is each you flip head you win the amount you bet and each time you flip tails you lose the amount you bet as well. A gambler starts with 100$ dollar, cannot bet more money than he has and can play 10 games (the bet must be nonnegative). Our goal is to maximize his expected payout by using an optimal betting strategy. To find this we will use stochastic dynamic programming: Failed to parse (syntax error): {\displaystyle V_n(x) = \max_{0<&alpha<1} \, \\{[0.6*V_n-1(x+&alpha*x)+0.4*V_n-1(x-&alpha*x)]}}

Applications

Conclusions

References