illeamn
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Modeling Sequential Decision Problems ## Introduction Sequential decision problems involve making a series of interconnected decisions over time. The outcome of each decision influences the subsequent states and available choices. These problems are characterized by the following sequence: `State -> Decision -> New Information -> State -> Decision -> New Information -> ... ` ### Key Elements * **State:** The state of the system captures all the information needed to make a decision at a particular time. This can include physical resources, information, and beliefs about uncertain quantities. * **Decision:** The decision is the action taken based on the current state. * **New Information:** This is the information that arrives after a decision is made and influences the next state. * **Policy:** A policy is a method or rule for making decisions. It can be a simple rule of thumb or a complex algorithm. ### Examples * **Business:** Deciding what products to sell, what prices to charge, and how to manage inventory. * **Finance:** Choosing which stocks to invest in and when to buy or sell them. * **Healthcare:** Determining the best treatment plan for a patient based on their medical history and current condition. * **Engineering:** Designing systems that can adapt to changing conditions, such as traffic control systems or energy management systems. ### Challenges & Approaches The uncertainty inherent in sequential decision problems poses a significant challenge. The outcomes of decisions and the arrival of new information are often random, making it difficult to determine the optimal course of action. Common approaches include: * **Dynamic programming:** Breaks down the problem into smaller, manageable subproblems. * **Reinforcement learning:** Learns optimal strategies through trial and error. * **Stochastic programming:** Formulates the problem as a mathematical optimization problem. ## A Six Step Modeling Process 1. **The narrative:** Describe the problem in plain language, outlining the sequence of events and decisions. 2. **Core elements:** Identify the key metrics, decisions, and sources of uncertainty. 3. **Mathematical model:** Define state variables, decision variables, exogenous information, transition function, and objective function. 4. **Uncertainty model:** Specify how uncertainties are represented and incorporated into the model. 5. **Policy design:** Develop strategies (policy search, lookahead policies) to map states to decisions. 6. **Policy evaluation:** Assess the performance of different policies under various scenarios to identify the optimal one. ## The Mathematical Modeling Framework A core aspect of solving sequential decision problems is formulating a mathematical model. This model comprises several key elements: ### State Variables The state variable $S_t$ encapsulates all necessary and sufficient information to model the system from time t onwards. It includes information needed to calculate costs/contributions, constraints on decisions, and the system's evolution over time. $S_t$ consists of three types of information: * **Physical state $R_t$:** This represents the controlled resources or quantities within the system (e.g., inventory levels, resource allocations). $R_t$ can be a scalar or a vector, where each element might correspond to a specific resource type or location. * **Other information $I_t$:** This encompasses any deterministic information not included in $R_t$, such as prices, demand forecasts, or known parameters. While often evolving exogenously, $I_t$ may also be influenced by decisions. * **Belief state $B_t$:** This captures information about probability distributions describing uncertain parameters or quantities. $B_t$ may include the mean and variance of a normal distribution for a demand forecast or represent probabilities associated with various events. ### Decision Variables Decision variables represent the choices available at each time step $t$. These can take various forms: * **Binary:** Yes/no decisions (e.g., whether to sell an asset). * **Discrete:** Selecting from a finite set of options (e.g., which product to advertise). * **Continuous:** Variables that can take on any value within a range (e.g., prices, temperatures). * **Vectors:** Collections of binary, discrete, or continuous variables (e.g., resource allocation across multiple locations). * **Categorical:** Selecting from a set of non-ordered categories (e.g., features to highlight in an advertisement). ### Exogenous Information This is the information that arrives after a decision $x_t$ is made. We let $W_{t+1}$ be any new information that first becomes known at time $t+1$ (that is, between $t$ and $t+1$), where the source of the information is from outside of our system (which is why it is "exogenous"). When modeling specific variables, we use "hats" to indicate exogenous information. Thus, $\hat{D}_{t+1}$ could be the demand that arises between $t$ and $t+1$, or we could let $\hat{p}_{t+1}$ be the change in the price between $t$ and $t+1$. ### Transition Function The transition function $S^M$ governs the evolution of the system state over time: $$ S_{t+1} = S^M(S_t,x_t,W_{t+1}) $$ This function describes how the current state, decision, and new information combine to determine the subsequent state. It might capture: * Changes in physical resources (e.g., inventory updates, resource movements). * Information updates (e.g., changes in prices, weather). * Updates to beliefs about uncertain parameters (e.g., adjusting demand forecast distributions). ### Objective Function The objective function quantifies the decision-maker's goal. While various formulations exist, a common approach is to maximize the expected total contribution over a finite horizon: $$ \max_{\pi} \mathbb{E}\left\{ \sum_{t=0}^T C_t(S_t, X^\pi_t(S_t)) | S_0 \right\} $$ where: * $C_t$ is the contribution function at time $t$. * $X^{\pi}(S_t)$ represents the decision made at time $t$ under policy $\pi$. This framework provides a structured way to represent and analyze sequential decision problems, incorporating uncertainties, decisions, and their consequences over time. ## Modeling Uncertainty Uncertainty is a key aspect of sequential decision problems. It can arise from various sources, including unknown quantities, parameters, and future events. In the modeling process, uncertainty is incorporated through two mechanisms: 1. **The initial state variables $S_0$:** These variables can capture the parameters of probability distributions that describe quantities or parameters that are not known with certainty. For example, the initial state might include the mean and variance of a demand distribution, reflecting the uncertainty in future demand. 2. **The exogenous information process $W_1, \dots, W_T$:** This process represents new information that arrives over time, such as actual demand, market prices, or patient responses to treatment. This information is often random and can significantly impact the system's state and the subsequent decisions. To test and evaluate policies under uncertainty, we need to generate samples of the exogenous information process. This can be done using historical data, real-time observations, or simulations based on mathematical models. Each sample path represents a possible sequence of future events, and by evaluating a policy over multiple sample paths, we can assess its average performance and robustness to uncertainty. ## Example: A Simple Inventory Problem **The Narrative:** A pizzeria needs to decide how many pounds of sausage to order at the end of each day $t$. Leftover sausage can be stored for the next day. The sausage cost and selling price are known in advance, but the daily demand is uncertain. ### Core Elements * **Metric:** Maximize net income (profit minus cost). * **Decision:** Determine the order quantity. * **Sources of Uncertainty:** Daily demand for sausage. ### Mathematical Model * **State Variable:** Inventory level at the end of day $t$, denoted as $R_{t}^{inv}$. Hence, $S_{t} = R_{t}^{inv}$. * **Decision Variable:** Order quantity at time $t$, denoted as $x_t$. The decision is made using a policy $X^\pi(S_t)$ that will be designed later. * **Exogenous Information:** Random demand for the next day, denoted as $\hat{D}_{t+1}$. Thus $W_{t+1} = \hat D_{t+1}$. * **Transition Function:** $$R_{t+1}^{inv} = \max\left\{0, R_t^{inv} + x_t - \hat{D}_{t+1} \right\}$$ This equation describes the evolution of inventory over time, considering the previous inventory, order quantity, and demand. * **Objective Function:** The contribution function is given by $$C(S_t, x_t, D_{t+1}) = -c x_t + p \min\{R_t^{inv} + x_t, \hat{D}_{t+1}\}$$ This function calculates the net income, subtracting the cost of ordering from the revenue generated by sales (up to the demand or available inventory). Given a sequence of demands $\hat{D}_1, \dots, \hat{D}_T$ the performance of a policy $\hat F^{\pi}$ would be $$\hat{F}^\pi = \sum_{t=0}^T C(S_t, X^\pi(S_t), \hat{D}_{t+1})$$ Since demand is random, we take the expectation: $$F^\pi = \mathbb{E}\left\{\sum_{t=0}^T C(S_t, X^\pi(S_t), \hat{D}_{t+1}) | S_0\right\}$$ ### Uncertainty Model We assume that the demand follows a normal distribution with known mean $\bar D$ and standard deviation $\bar{\sigma}$: $$ \hat{D}_{t+1} \sim N(\bar{D}, \bar{\sigma}^2) $$ To estimate the value of a policy, we can generate multiple demand sequences, each representing a possible scenario. ### Designing Policies A common strategy for inventory problems is the "order-up-to" policy: $$ X^\pi(S_t | \theta) = \begin{cases} \theta^{max} - R_t & \text{if } R_t < \theta^{min}, \\ 0 & \text{otherwise}, \end{cases} $$ where $\theta = (\theta^{min}, \theta^{max})$ are parameters that need to be tuned. The policy orders enough sausage to bring the inventory up to $\theta^{max}$ if the current inventory is below $\theta^{min}$. ### Evaluating Policies Since we cannot compute the exact expectation in the objective function, we use the generated demand sequences to approximate it: $$ \bar{F}^\pi(\theta) = \frac{1}{N} \sum_{n=1}^N \sum_{t=0}^T C(S_t, X^\pi(S_t | \theta), \hat{D}_t^{n+1}) $$ This allows us to compare different policies and choose the one with the highest estimated average performance. ## Designing Policies Designing effective policies is a central challenge in sequential decision problems. Policies are essentially functions that map the current state of the system to a decision. There are two fundamental strategies for creating policies: 1. **Policy search:** This strategy involves searching over a family of functions to find the one that performs best on average over time. This can be done by simulating the performance of different policies under various scenarios and selecting the one that yields the best results. 2. **Lookahead policies:** These policies optimize the current decision by considering both its immediate impact and an approximation of its future consequences. This necessitates a model that can forecast the future state of the system based on the current state and decision. These two strategies can be further divided into four classes of policies: 1. **Policy function approximations (PFAs):** These are analytical functions that directly map a state to an action. Examples include simple rules of thumb or linear models. 2. **Cost function approximations (CFAs):** These are parameterized optimization models that are designed to adapt and improve over time. 3. **Value function approximations (VFAs):** These policies approximate the long-term value of being in a particular state, and then choose actions that maximize this value. 4. **Direct lookahead approximations (DLAs):** These policies involve optimizing over a planning horizon, considering the potential future states and actions. The choice of policy depends on the specific problem and the available computational resources. In practice, a combination of different policy classes may be used to achieve the best performance. ## Reference * Chap 1 of Warren B. Powell (2022), "Sequential Decision Analytics and Modeling: Modeling with Python" [link](https://castle.princeton.edu/sdamodeling/) * Chap 1 of Warren B. Powell (2022), "Reinforcement Learning and Stochastic Optimization: A Unified Framework for Sequential Decisions" [link](https://castle.princeton.edu/RLSO/)

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully