Difference between revisions of "Reverse Dynamic"

Line 4: Line 4:
 
__TOC__
 
__TOC__
  
In some dynamic programming algorithms, you start with a known final value, then compute the value at each time point as a function of future values. This dynamic-in-reverse can be accomplished using Dynamic by specifying the recurrence as the first parameter to dynamic, followed by the final value(s), and then specifying reverse: true.
+
In some dynamic programming algorithms, you start with a known final value, then compute the value at each time point as a function of future values. This dynamic-in-reverse can be accomplished using '''Dynamic''' by specifying the recurrence as the first parameter to dynamic, followed by the final value(s), and then specifying <code>reverse: true</code>.
  
The example model “Optimal Path Dynamic Programming.ana” computes an optimal
+
The example model <code>“Optimal Path Dynamic Programming.ana”</code> computes an optimal path over a finite horizon. There is a final payout in the last time period, as a function of the final state, and an action cost (a function of action and state) at each intermediate step. Dynamic programming is used to find the optimal policy and the utility at each <code>State x Action x Time</code> point.
path over a finite horizon. There is a final payout in the last time period, as a function of the final state, and an action cost (a function of action and state) at each intermediate step. Dynamic programming is used to find the optimal policy and the utility at each State x Action x Time point.
 
  
  Decision Best_Action := ArgMax(Sxa_utility,Action)
+
  Decision Best_Action := ArgMax(Sxa_utility, Action)
 
  Objective Sxa_utility :=
 
  Objective Sxa_utility :=
 
     Dynamic(
 
     Dynamic(
Line 15: Line 14:
 
               [State = Transition] - Action_cost,
 
               [State = Transition] - Action_cost,
 
         Final_payout,
 
         Final_payout,
         reverse : true )
+
         reverse: true)
  
Notice the use of [Time+1] rather than the [Time-1] that is commonly used in forward Dynamic loops.
+
Notice the use of <code>[Time + 1]</code> rather than the <code>[Time - 1]</code> that is commonly used in forward '''Dynamic''' loops.
  
 
==See Also==
 
==See Also==
 +
* [[Dynamic]]()
 +
 
<footer>Dynamic on non-Time Indexes / {{PAGENAME}} / Importing, Exporting, and OLE Linking Data</footer>
 
<footer>Dynamic on non-Time Indexes / {{PAGENAME}} / Importing, Exporting, and OLE Linking Data</footer>

Revision as of 08:31, 18 December 2015

In some dynamic programming algorithms, you start with a known final value, then compute the value at each time point as a function of future values. This dynamic-in-reverse can be accomplished using Dynamic by specifying the recurrence as the first parameter to dynamic, followed by the final value(s), and then specifying reverse: true.

The example model “Optimal Path Dynamic Programming.ana” computes an optimal path over a finite horizon. There is a final payout in the last time period, as a function of the final state, and an action cost (a function of action and state) at each intermediate step. Dynamic programming is used to find the optimal policy and the utility at each State x Action x Time point.

Decision Best_Action := ArgMax(Sxa_utility, Action)
Objective Sxa_utility :=
    Dynamic(
        Sxa_utility[Time + 1][Action = Best_action[Time + 1]]
             [State = Transition] - Action_cost,
        Final_payout,
        reverse: true)

Notice the use of [Time + 1] rather than the [Time - 1] that is commonly used in forward Dynamic loops.

See Also

Comments


You are not allowed to post comments.