Markov decision process: Difference between revisions

Content deleted Content added
Tag: references removed
OAbot (talk | contribs)
m Open access bot: url-access=subscription updated in citation with #oabot.
 
(32 intermediate revisions by 18 users not shown)
Line 1:
{{Short description|Mathematical model for sequential decision making under uncertainty}}
In mathematics, a '''Markov decision process''' ('''MDP''') is a [[discrete-time]] [[stochastic]] [[Optimal control theory|control]] process. It provides a mathematical framework for modeling [[decision making]] in situations where outcomes are partly [[Randomness#In mathematics|random]] and partly under the control of a decision maker. MDPs are useful for studying [[optimization problem]]s solved via [[dynamic programming]]. MDPs were known at least as early as the 1950s;<ref>{{cite journal|first=R.|last=Bellman|author-link=Richard E. Bellman|url=http://www.iumj.indiana.edu/IUMJ/FULLTEXT/1957/6/56038|title=A Markovian Decision Process|journal=Journal of Mathematics and Mechanics|volume=6|year=1957|issue=5|pages=679–684|jstor=24900506}}</ref> a core body of research on Markov decision processes resulted from [[Ronald A. Howard|Ronald Howard]]'s 1960 book, ''Dynamic Programming and Markov Processes''.<ref>{{cite book|first=Ronald A.|last=Howard|title=Dynamic Programming and Markov Processes|publisher=The M.I.T. Press|year=1960}}</ref> They are used in many disciplines, including [[robotics]], [[automatic control]], [[economics]] and [[manufacturing]]. The name of MDPs comes from the Russian mathematician [[Andrey Markov]] as they are an extension of [[Markov chain]]s.
 
'''Markov decision process''' ('''MDP'''), also called a [[Stochastic dynamic programming|stochastic dynamic program]] or stochastic control problem, is a model for [[sequential decision making]] when [[Outcome (probability)|outcomes]] are uncertain.<ref>{{Cite book |last=Puterman |first=Martin L. |title=Markov decision processes: discrete stochastic dynamic programming |date=1994 |publisher=Wiley |isbn=978-0-471-61977-2 |series=Wiley series in probability and mathematical statistics. Applied probability and statistics section |___location=New York}}</ref>
At each time step, the process is in some state <math>s</math>, and the decision maker may choose any action <math>a</math> that is available in state <math>s</math>. The process responds at the next time step by randomly moving into a new state <math>s'</math>, and giving the decision maker a corresponding reward <math>R_a(s,s')</math>.
 
Originating from [[operations research]] in the 1950s,<ref>{{Cite book |last1=Schneider |first1=S. |last2=Wagner |first2=D. H. |chapter=Error detection in redundant systems |date=1957-02-26 |title=Papers presented at the February 26-28, 1957, western joint computer conference: Techniques for reliability on - IRE-AIEE-ACM '57 (Western) |chapter-url=https://dl.acm.org/doi/10.1145/1455567.1455587 |___location=New York, NY, USA |publisher=Association for Computing Machinery |pages=115–121 |doi=10.1145/1455567.1455587 |isbn=978-1-4503-7861-1}}</ref><ref>{{Cite journal |last=Bellman |first=Richard |date=1958-09-01 |title=Dynamic programming and stochastic control processes |url=https://linkinghub.elsevier.com/retrieve/pii/S0019995858800030 |journal=Information and Control |volume=1 |issue=3 |pages=228–239 |doi=10.1016/S0019-9958(58)80003-0 |issn=0019-9958|url-access=subscription }}</ref> MDPs have since gained recognition in a variety of fields, including [[ecology]], [[economics]], [[Health care|healthcare]], [[telecommunications]] and [[reinforcement learning]].<ref name=":0">{{Cite book |last1=Sutton |first1=Richard S. |title=Reinforcement learning: an introduction |last2=Barto |first2=Andrew G. |date=2018 |publisher=The MIT Press |isbn=978-0-262-03924-6 |edition=2nd |series=Adaptive computation and machine learning series |___location=Cambridge, Massachusetts}}</ref> Reinforcement learning utilizes the MDP framework to model the interaction between a learning agent and its environment. In this framework, the interaction is characterized by states, actions, and rewards. The MDP framework is designed to provide a simplified representation of key elements of [[artificial intelligence]] challenges. These elements encompass the understanding of [[Causality|cause and effect]], the management of uncertainty and nondeterminism, and the pursuit of explicit goals.<ref name=":0" />
The [[probability]] that the process moves into its new state <math>s'</math> is influenced by the chosen action. Specifically, it is given by the [[state transition function]] <math>P_a(s,s')</math>. Thus, the next state <math>s'</math> depends on the current state <math>s</math> and the decision maker's action <math>a</math>. But given <math>s</math> and <math>a</math>, it is conditionally independent of all previous states and actions; in other words, the state transitions of an MDP satisfy the [[Markov property]].
 
The name comes from its connection to [[Markov chain|Markov chains]], a concept developed by the Russian mathematician [[Andrey Markov]]. The "Markov" in "Markov decision process" refers to the underlying structure of [[Transition system|state transitions]] that still follow the [[Markov property]]. The process is called a "decision process" because it involves making decisions that influence these state transitions, extending the concept of a Markov chain into the realm of decision-making under uncertainty.
Markov decision processes are an extension of [[Markov chain]]s; the difference is the addition of actions (allowing choice) and rewards (giving motivation). Conversely, if only one action exists for each state (e.g. "wait") and all rewards are the same (e.g. "zero"), a Markov decision process reduces to a Markov chain.
 
==Definition==
Line 14 ⟶ 13:
* <math>S</math> is a [[set (mathematics)|set]] of states called the ''<dfn>state space</dfn>''. The state space may be discrete or continuous, like the [[set of real numbers]].
* <math>A</math> is a set of actions called the ''<dfn>action space</dfn>'' (alternatively, <math>A_s</math> is the set of actions available from state <math>s</math>). As for state, this set may be discrete or continuous.
* <math>P_a(s, s')</math> is, on an intuitive level, the probability that action <math>a</math> in state <math>s</math> at time <math>t</math> will lead to state <math>s'</math> at time <math>t+1</math>. In general, this probability transition is defined to satisfy <math>\Pr(s_{t+1}\in S' \mid s_t = s, a_t=a)=\int_{S'} P_a(s, s')ds',</math> for every <math>S'\subseteq S</math> measurable. In case the state space is discrete, the integral is intended with respect to the [[counting measure]], so that the latter simplifies as <math>P_a(s, s')= \Pr(s_{t+1}=s' \mid s_t = s, a_t=a)</math>; In case <math>S\subseteq \mathbb R^d</math>, the integral is usually intended with respect to the [[Lebesgue measure]].
*<math>R_a(s, s')</math> is the immediate reward (or expected immediate reward) received after transitioning from state <math>s</math> to state <math>s'</math>, due to action <math>a</math>.
 
Line 27 ⟶ 26:
:<math>E\left[\sum^{\infty}_{t=0} {\gamma^t R_{a_t} (s_t, s_{t+1})}\right] </math> (where we choose <math>a_t = \pi(s_t)</math>, i.e. actions given by the policy). And the expectation is taken over <math>s_{t+1} \sim P_{a_t}(s_t,s_{t+1})</math>
 
where <math>\ \gamma \ </math> is the discount factor satisfying <math>0 \le\ \gamma\ \le\ 1</math>, which is usually close to <math>1</math> (for example, <math> \gamma = 1/(1+r) </math> for some discount rate <math>r</math>). A lower discount factor motivatesmakes the decision maker tomore favorshort-sighted, takingin actionsthat early,it rathercomparatively thandisregards postponethe themeffect that following its current policy has at times lying further in the indefinitelyfuture.
 
Another possible, but strictly related, objective that is commonly used is the <math>H-</math>step return. This time, instead of using a discount factor <math>\ \gamma \ </math>, the agent is interested only in the first <math>H</math> steps of the process, with each reward having the same weight.
A policy that maximizes the function above is called an ''<dfn>optimal policy</dfn>'' and is usually denoted <math>\pi^*</math>. A particular MDP may have multiple distinct optimal policies. Because of the Markov property, it can be shown that the optimal policy is a function of the current state, as assumed above.
 
:<math>E\left[\sum^{H-1}_{t=0} {R_{a_t} (s_t, s_{t+1})}\right] </math> (where we choose <math>a_t = \pi(s_t)</math>, i.e. actions given by the policy). And the expectation is taken over <math>s_{t+1} \sim P_{a_t}(s_t,s_{t+1})</math>
 
where <math>\ H \ </math> is the time horizon. Compared to the previous objective, the latter one is more used in [[Learning Theory]].
 
A policy that maximizes the function above is called an ''<dfn>optimal policy</dfn>'' and is usually denoted <math>\pi^*</math>. A particular MDP may have multiple distinct optimal policies. Because of the [[Markov property]], it can be shown that the optimal policy is a function of the current state, as assumed above.
 
===Simulator models===
Line 35 ⟶ 40:
In many cases, it is difficult to represent the transition probability distributions, <math>P_a(s, s')</math>, explicitly. In such cases, a simulator can be used to model the MDP implicitly by providing samples from the transition distributions. One common form of implicit MDP model is an episodic environment simulator that can be started from an initial state and yields a subsequent state and reward every time it receives an action input. In this manner, trajectories of states, actions, and rewards, often called ''<dfn>episodes</dfn>'' may be produced.
 
Another form of simulator is a ''<dfn>generative model</dfn>'', a single step simulator that can generate samples of the next state and reward given any state and action.<ref name="Kearns Sparse">{{cite journal |last1=Kearns |first1=Michael |last2=Mansour |first2=Yishay |last3=Ng |first3=Andrew |title=A Sparse Sampling Algorithm for Near-Optimal Planning in Large Markov Decision Processes |journal=Machine Learning |date=2002 |volume=49 |issue=193–208 |pages=193–208 |doi=10.1023/A:1017932429737 |doi-access=free }}</ref> (Note that this is a different meaning from the term [[generative model]] in the context of [[statistical classification]].) In [[algorithms]] that are expressed using [[pseudocode]], <math>G</math> is often used to represent a generative model. For example, the expression <math>s', r \gets G(s, a)</math> might denote the action of sampling from the generative model where <math>s</math> and <math>a</math> are the current state and action, and <math>s'</math> and <math>r</math> are the new state and reward. Compared to an episodic simulator, a generative model has the advantage that it can yield data from any state, not only those encountered in a trajectory.
 
These model classes form a hierarchy of information content: an explicit model trivially yields a generative model through sampling from the distributions, and repeated application of a generative model yields an episodic simulator. In the opposite direction, it is only possible to learn approximate models through [[regression analysis|regression]]. The type of model available for a particular MDP plays a significant role in determining which solution algorithms are appropriate. For example, the [[dynamic programming]] algorithms described in the next section require an explicit model, and [[Monte Carlo tree search]] requires a generative model (or an episodic simulator that can be copied at any state), whereas most [[#Reinforcement learning|reinforcement learning]] algorithms require only an episodic simulator.
 
==Example==
 
[[File:Cartpole.gif|thumb|Pole Balancing example (rendering of the environment from the [[Open AI gym benchmark]])]]
 
An example of MDP is the Pole-Balancing model, which comes from classic control theory.
 
In this example, we have
 
* <math>S</math> is the set of ordered tuples <math>(\theta,\dot \theta, x, \dot x )\subset \mathbb R^4</math> given by pole angle, angular velocity, position of the cart and its speed.
* <math>A</math> is <math>\{-1,1\}</math>, corresponding to applying a force on the left (right) on the cart.
* <math>P_a(s, s')</math> is the transition of the system, which in this case is going to be deterministic and driven by the laws of mechanics.
*<math>R_a(s, s')</math> is <math>1</math> if the pole is up after the transition, zero otherwise. Therefore, this function only depend on <math>s'</math> in this specific case.
 
==Algorithms==
 
Solutions for MDPs with finite state and action spaces may be found through a variety of methods such as [[dynamic programming]]. The algorithms in this section apply to MDPs with finite state and action spaces and explicitly given transition probabilities and reward functions, but the basic concepts may be extended to handle other problem classes, for example using [[function approximation]]. Also, some processes with countably infinite state and action spaces can be <i>exactly</i> reduced to ones with finite state and action spaces.<ref name="Wrobel 1984">{{cite journal|first=A.|last=Wrobel|title=On Markovian decision models with a finite skeleton|journal=Zeitschrift für Operations Research|date=1984|volume=28|issue=1|pages=17–27|doi=10.1007/bf01919083|s2cid=2545336}}</ref>
 
The standard family of algorithms to calculate optimal policies for finite state and action MDPs requires storage for two arrays indexed by state: ''value'' <math>V</math>, which contains real values, and ''policy'' <math>\pi</math>, which contains actions. At the end of the algorithm, <math>\pi</math> will contain the solution and <math>V(s)</math> will contain the discounted sum of the rewards to be earned (on average) by following that solution from state <math>s</math>.
Line 57 ⟶ 75:
====Value iteration====
In value iteration {{harv|Bellman|1957}}, which is also called [[backward induction]],
the <math>\pi</math> function is not used; instead, the value of <math>\pi(s)</math> is calculated within <math>V(s)</math> whenever it is needed. Substituting the calculation of <math>\pi(s)</math> into the calculation of <math>V(s)</math> gives the combined step;{{explain|reason=The derivation of the substituion is needed|date=July 2018}}:
:<math> V_{i+1}(s) := \max_a \left\{ \sum_{s'} P_a(s,s') \left( R_a(s,s') + \gamma V_i(s') \right) \right\}, </math>
 
Line 77 ⟶ 95:
In this variant, the steps are preferentially applied to states which are in some way important – whether based on the algorithm (there were large changes in <math>V</math> or <math>\pi</math> around those states recently) or based on use (those states are near the starting state, or otherwise of interest to the person or program using the algorithm).
 
===Computational complexity===
 
Algorithms for finding optimal policies with [[time complexity]] polynomial in the size of the problem representation exist for finite MDPs. Thus, [[decision problem]]s based on MDPs are in computational [[complexity class]] [[P (complexity)|P]].<ref>{{cite journal
Line 88 ⟶ 106:
| volume=12
| issue=3
| pages=441–450 | doi=10.1287/moor.12.3.441
| access-date=November 2, 2023| hdl=1721.1/2893
| hdl-access=free
| url-access=subscription
}}</ref> However, due to the [[curse of dimensionality]], the size of the problem representation is often exponential in the number of state and action variables, limiting exact solution techniques to problems that have a compact representation. In practice, online planning techniques such as [[Monte Carlo tree search]] can find useful solutions in larger problems, and, in theory, it is possible to construct online planning algorithms that can find an arbitrarily near-optimal policy with no computational complexity dependence on the size of the state space.<ref>{{cite journal|last1=Kearns|first1=Michael|last2=Mansour|first2=Yishay|last3=Ng|first3=Andrew|date=November 2002|title=A Sparse Sampling Algorithm for Near-Optimal Planning in Large Markov Decision Processes|url=https://link.springer.com/article/10.1023/A:1017932429737|journal=Machine Learning|volume=49|doi=10.1023/A:1017932429737|access-date=November 2, 2023|doi-access=free}}</ref>
}}</ref> However, due to the [[curse of dimensionality]], the size of the problem representation is often exponential in the number of state and action variables, limiting exact solution techniques to problems that have a compact representation. In practice, online planning techniques such as [[Monte Carlo tree search]] can find useful solutions in larger problems, and, in theory, it is possible to construct online planning algorithms that can find an arbitrarily near-optimal policy with no computational complexity dependence on the size of the state space.<ref>{{cite journal|last1=Kearns|first1=Michael|last2=Mansour|first2=Yishay|last3=Ng|first3=Andrew|date=November 2002|title=A Sparse Sampling Algorithm for Near-Optimal Planning in Large Markov Decision Processes|journal=Machine Learning|volume=49|issue=2/3 |pages=193–208 |doi=10.1023/A:1017932429737|doi-access=free}}</ref>
 
==Extensions and generalizations==
Line 100 ⟶ 119:
The solution above assumes that the state <math>s</math> is known when action is to be taken; otherwise <math>\pi(s)</math> cannot be calculated. When this assumption is not true, the problem is called a partially observable Markov decision process or POMDP.
 
=== Constrained Markov decision processes ===
===Reinforcement learning===
Constrained Markov decision processes (CMDPS) are extensions to Markov decision process (MDPs). There are three fundamental differences between MDPs and CMDPs.<ref>{{cite book|last=Altman|first=Eitan|title=Constrained Markov decision processes|volume=7|publisher=CRC Press|year=1999}}</ref>
{{main|Reinforcement learning}}
 
* There are multiple costs incurred after applying an action instead of one.
[[Reinforcement learning]] uses MDPs where the probabilities or rewards are unknown.<ref>{{cite journal|author1=Shoham, Y.|author2= Powers, R.|author3= Grenager, T. |year=2003|title= Multi-agent reinforcement learning: a critical survey |pages= 1–13|journal= Technical Report, Stanford University|url=http://jmvidal.cse.sc.edu/library/shoham03a.pdf|access-date=2018-12-12}}</ref>
* CMDPs are solved with [[Linear programming|linear programs]] only, and [[dynamic programming]] does not work.
* The final policy depends on the starting state.
 
The method of Lagrange multipliers applies to CMDPs.
For this purpose it is useful to define a further function, which corresponds to taking the action <math>a</math> and then continuing optimally (or according to whatever policy one currently has):
Many Lagrangian-based algorithms have been developed.
:<math>\ Q(s,a) = \sum_{s'} P_a(s,s') (R_a(s,s') + \gamma V(s')).\ </math>
* Natural policy gradient primal-dual method.<ref>
{{cite conference
| last1 = Ding | first1 =Dongsheng
| last2 = Zhang | first2 = Kaiqing
| last3 = Jovanovic | first3 = Mihailo
| last4 = Basar | first4 = Tamer
| year = 2020
| title = Natural policy gradient primal-dual method for constrained Markov decision processes
| conference = Advances in Neural Information Processing Systems
}}
</ref>
 
There are a number of applications for CMDPs. It has recently been used in [[motion planning]] scenarios in robotics.<ref>{{cite conference |last1=Feyzabadi |first1=S. |last2=Carpin |first2=S. |title=Risk-aware path planning using hierarchical constrained Markov Decision Processes |book-title=Automation Science and Engineering (CASE) |conference=IEEE International Conference |pages=297, 303 |date=18–22 Aug 2014 |url=https://www.researchgate.net/publication/270105954}}</ref>
While this function is also unknown, experience during learning is based on <math>(s, a)</math> pairs (together with the outcome <math>s'</math>; that is, "I was in state <math>s</math> and I tried doing <math>a</math> and <math>s'</math> happened"). Thus, one has an array <math>Q</math> and uses experience to update it directly. This is known as [[Q-learning]].
 
===Continuous-time Markov decision process===
Reinforcement learning can solve Markov-Decision processes without explicit specification of the transition probabilities; the values of the transition probabilities are needed in value and policy iteration. In reinforcement learning, instead of explicit specification of the transition probabilities, the transition probabilities are accessed through a simulator that is typically restarted many times from a uniformly random initial state. Reinforcement learning can also be combined with function approximation to address problems with a very large number of states.
In discrete-time Markov Decision Processes, decisions are made at discrete time intervals. However, for '''continuous-time Markov decision processes''', decisions can be made at any time the decision maker chooses. In comparison to discrete-time Markov decision processes, continuous-time Markov decision processes can better model the decision-making process for a system that has [[Continuous time|continuous dynamics]], i.e.,&nbsp;the system dynamics is defined by [[ordinary differential equation]]s (ODEs). These kind of applications raise in [[queueing system]]s, epidemic processes, and [[population process]]es.
 
Like the discrete-time Markov decision processes, in continuous-time Markov decision processes the agent aims at finding the optimal ''policy'' which could maximize the expected cumulated reward. The only difference with the standard case stays in the fact that, due to the continuous nature of the time variable, the sum is replaced by an integral:
=== Learning automata ===
:<math>\max \operatorname{E}_\pi\left[\left. \int_0^\infty\gamma^t r(s(t),\pi(s(t))) \, dt \;\right| s_0 \right]</math>
{{main|Learning automata}}
Another application of MDP process in [[machine learning]] theory is called learning automata. This is also one type of reinforcement learning if the environment is stochastic. The first detail '''learning automata''' paper is surveyed by [[Kumpati S. Narendra|Narendra]] and Thathachar (1974), which were originally described explicitly as [[finite state automata]].<ref>{{Cite journal|last1=Narendra|first1=K. S.|author-link=Kumpati S. Narendra|last2=Thathachar|first2=M. A. L.|year=1974 |title=Learning Automata – A Survey|journal=IEEE Transactions on Systems, Man, and Cybernetics|volume=SMC-4|issue=4|pages=323–334|doi=10.1109/TSMC.1974.5408453|issn=0018-9472|citeseerx=10.1.1.295.2280}}</ref> Similar to reinforcement learning, a learning automata algorithm also has the advantage of solving the problem when probability or rewards are unknown. The difference between learning automata and Q-learning is that the former technique omits the memory of Q-values, but updates the action probability directly to find the learning result. Learning automata is a learning scheme with a rigorous proof of convergence.<ref name="NarendraEtAl1989">{{Cite book|url=https://archive.org/details/learningautomata00nare|url-access=registration|title=Learning automata: An introduction|last1=Narendra|first1=Kumpati S.|author-link=Kumpati S. Narendra|last2=Thathachar|first2=Mandayam A. L.|year=1989|publisher=Prentice Hall|isbn=9780134855585|language=en}}</ref>
 
In learning automata theory, '''a stochastic automaton''' consists of:
* a set ''x'' of possible inputs,
* a set Φ = { Φ<sub>1</sub>, ..., Φ<sub>''s''</sub> } of possible internal states,
* a set α = { α<sub>1</sub>, ..., α<sub>''r''</sub> } of possible outputs, or actions, with ''r'' ≤ ''s'',
* an initial state probability vector ''p''(0) = ≪ ''p''<sub>1</sub>(0), ..., ''p<sub>s</sub>''(0) ≫,
* a [[computable function]] ''A'' which after each time step ''t'' generates ''p''(''t'' + 1) from ''p''(''t''), the current input, and the current state, and
* a function ''G'': Φ → α which generates the output at each time step.
The states of such an automaton correspond to the states of a "discrete-state discrete-parameter [[Markov process]]".{{sfn|Narendra|Thathachar|1974|loc=p.325 left}} At each time step ''t'' = 0,1,2,3,..., the automaton reads an input from its environment, updates P(''t'') to P(''t'' + 1) by ''A'', randomly chooses a successor state according to the probabilities P(''t'' + 1) and outputs the corresponding action. The automaton's environment, in turn, reads the action and sends the next input to the automaton.<ref name="NarendraEtAl1989" />
 
===Category theoretic interpretation===
Other than the rewards, a Markov decision process <math>(S,A,P)</math> can be understood in terms of [[Category theory]]. Namely, let <math>\mathcal{A}</math> denote the [[free monoid]] with generating set ''A''. Let '''Dist''' denote the [[Kleisli category]] of the [http://ncatlab.org/nlab/show/Giry+monad Giry monad]. Then a functor <math>\mathcal{A}\to\mathbf{Dist}</math> encodes both the set ''S'' of states and the probability function ''P''.
 
In this way, Markov decision processes could be generalized from monoids (categories with one object) to arbitrary categories. One can call the result <math>(\mathcal{C}, F:\mathcal{C}\to \mathbf{Dist})</math> a ''context-dependent Markov decision process'', because moving from one object to another in <math>\mathcal{C}</math> changes the set of available actions and the set of possible states.{{Citation needed|reason=No reference is provided|date=December 2020}}
 
==Continuous-time Markov decision process==
In discrete-time Markov Decision Processes, decisions are made at discrete time intervals. However, for '''continuous-time Markov decision processes''', decisions can be made at any time the decision maker chooses. In comparison to discrete-time Markov decision processes, continuous-time Markov decision processes can better model the decision-making process for a system that has [[Continuous time|continuous dynamics]], i.e.,&nbsp;the system dynamics is defined by [[ordinary differential equation]]s (ODEs).
 
===Definition===
In order to discuss the continuous-time Markov decision process, we introduce two sets of notations:
 
If the state space and action space are finite,
* <math>\mathcal{S}</math>: State space;
* <math>\mathcal{A}</math>: Action space;
* <math>q(i\mid j,a)</math>: <math>\mathcal{S}\times \mathcal{A} \rightarrow \triangle \mathcal{S}</math>, transition rate function;
* <math>R(i,a)</math>: <math>\mathcal{S}\times \mathcal{A} \rightarrow \mathbb{R}</math>, a reward function.
 
If the state space and action space are continuous,
* <math>\mathcal{X}</math>: state space;
* <math>\mathcal{U}</math>: space of possible control;
* <math>f(x,u)</math>: <math>\mathcal{X}\times \mathcal{U} \rightarrow \triangle \mathcal{X}</math>, a transition rate function;
* <math>r(x,u)</math>: <math>\mathcal{X}\times \mathcal{U} \rightarrow \mathbb{R}</math>, a reward rate function such that <math>r(x(t),u(t))\,dt = dR(x(t),u(t))</math>, where <math>R(x,u)</math> is the reward function we discussed in previous case.
 
===Problem===
Like the discrete-time Markov decision processes, in continuous-time Markov decision processes we want to find the optimal ''policy'' or ''control'' which could give us the optimal expected integrated reward:
:<math>\max \operatorname{E}_u\left[\left. \int_0^\infty\gamma^t r(x(t),u(t)) \, dt \;\right| x_0 \right]</math>
where <math>0\leq\gamma< 1.</math>
 
====Discrete space: Linear programming formulation====
If the state space and action space are finite, we could use linear programming to find the optimal policy, which was one of the earliest approaches applied. Here we only consider the ergodic model, which means our continuous-time MDP becomes an [[Ergodicity|ergodic]] continuous-time Markov chain under a stationary [[policy]]. Under this assumption, although the decision maker can make a decision at any time atin the current state, theythere couldis notno benefit more byin taking moremultiple than one actionactions. It is better for them to take an action only at the time when system is transitioning from the current state to another state. Under some conditions,(for<ref>{{Cite detail check Corollary 3.14 ofbook [|url=https://wwwlink.springer.com/mathematics/applications/book/10.1007/978-3-642-0254602547-41 ''|title=Continuous-Time Markov Decision Processes'']), |series=Stochastic Modelling and Applied Probability |date=2009 |volume=62 |language=en |doi=10.1007/978-3-642-02547-1|isbn=978-3-642-02546-4 }}</ref> if our optimal value function <math>V^*</math> is independent of state <math>i</math>, we will have the following inequality:
:<math>g\geq R(i,a)+\sum_{j\in S}q(j\mid i,a)h(j) \quad \forall i \in S \text{ and } a \in A(i)</math>
If there exists a function <math>h</math>, then <math>\bar V^*</math> will be the smallest <math>g</math> satisfying the above equation. In order to find <math>\bar V^*</math>, we could use the following linear programming model:
Line 183 ⟶ 179:
for all feasible solution <math>y(i,a)</math> to the D-LP. Once we have found the optimal solution <math>y^*(i,a)</math>, we can use it to establish the optimal policies.
 
====Continuous space: Hamilton–Jacobi–Bellman equation====
In continuous-time MDP, if the state space and action space are continuous, the optimal criterion could be found by solving [[Hamilton–Jacobi–Bellman equation|Hamilton–Jacobi–Bellman (HJB) partial differential equation]]. In order to discuss the HJB equation, we need to reformulate
our problem
:<math>\begin{align} V(xs(0),0)= {} & \max_umax_{a(t)=\pi(s(t))}\int_0^T r(xs(t),ua(t)) \, dt+D[xs(T)] \\
\text{s.t.}\quad & \frac{dxd s(t)}{dt}=f[t,xs(t),ua(t)]
\end{align}
</math>
 
<math>D(\cdot)</math> is the terminal reward function, <math>xs(t)</math> is the system state vector, <math>ua(t)</math> is the system control vector we try to find. <math>f(\cdot)</math> shows how the state vector changes over time. The Hamilton–Jacobi–Bellman equation is as follows:
:<math>0=\max_u ( r(t,xs,ua) +\frac{\partial V(t,xs)}{\partial x}f(t,xs,ua)) </math>
We could solve the equation to find the optimal control <math>ua(t)</math>, which could give us the optimal [[value function]] <math>V^*</math>
 
==Reinforcement learning==
===Application===
{{main|Reinforcement learning}}
Continuous-time Markov decision processes have applications in [[queueing system]]s, epidemic processes, and [[population process]]es.
 
[[Reinforcement learning]] is an interdisciplinary area of [[machine learning]] and [[optimal control]] that has, as main objective, finding an approximately optimal policy for MDPs where transition probabilities and rewards are unknown.<ref>{{cite journal|author1=Shoham, Y.|author2= Powers, R.|author3= Grenager, T. |year=2003|title= Multi-agent reinforcement learning: a critical survey |pages= 1–13|journal= Technical Report, Stanford University|url=http://jmvidal.cse.sc.edu/library/shoham03a.pdf|access-date=2018-12-12}}</ref>
 
Reinforcement learning can solve Markov-Decision processes without explicit specification of the transition probabilities which are instead needed to perform policy iteration. In this setting, transition probabilities and rewards must be learned from experience, i.e. by letting an agent interact with the MDP for a given number of steps. Both on a theoretical and on a practical level, effort is put in maximizing the sample efficiency, i.e. minimimizing the number of samples needed to learn a policy whose performance is <math>\varepsilon-</math>close to the optimal one (due to the stochastic nature of the process, learning the optimal policy with a finite number of samples is, in general, impossible).
 
===Reinforcement Learning for discrete MDPs===
For the purpose of this section, it is useful to define a further function, which corresponds to taking the action <math>a</math> and then continuing optimally (or according to whatever policy one currently has):
:<math>\ Q(s,a) = \sum_{s'} P_a(s,s') (R_a(s,s') + \gamma V(s')).\ </math>
 
While this function is also unknown, experience during learning is based on <math>(s, a)</math> pairs (together with the outcome <math>s'</math>; that is, "I was in state <math>s</math> and I tried doing <math>a</math> and <math>s'</math> happened"). Thus, one has an array <math>Q</math> and uses experience to update it directly. This is known as [[Q-learning]].
 
==Other scopes==
 
=== Learning automata ===
{{main|Learning automata}}
Another application of MDP process in [[machine learning]] theory is called learning automata. This is also one type of reinforcement learning if the environment is stochastic. The first detail '''learning automata''' paper is surveyed by [[Kumpati S. Narendra|Narendra]] and Thathachar (1974), which were originally described explicitly as [[finite-state automata]].<ref>{{Cite journal|last1=Narendra|first1=K. S.|author-link=Kumpati S. Narendra|last2=Thathachar|first2=M. A. L.|year=1974 |title=Learning Automata – A Survey|journal=IEEE Transactions on Systems, Man, and Cybernetics|volume=SMC-4|issue=4|pages=323–334|doi=10.1109/TSMC.1974.5408453|issn=0018-9472|citeseerx=10.1.1.295.2280}}</ref> Similar to reinforcement learning, a learning automata algorithm also has the advantage of solving the problem when probability or rewards are unknown. The difference between learning automata and Q-learning is that the former technique omits the memory of Q-values, but updates the action probability directly to find the learning result. Learning automata is a learning scheme with a rigorous proof of convergence.<ref name="NarendraEtAl1989">{{Cite book|url=https://archive.org/details/learningautomata00nare|url-access=registration|title=Learning automata: An introduction|last1=Narendra|first1=Kumpati S.|author-link=Kumpati S. Narendra|last2=Thathachar|first2=Mandayam A. L.|year=1989|publisher=Prentice Hall|isbn=9780134855585|language=en}}</ref>
 
In learning automata theory, '''a stochastic automaton''' consists of:
* a set ''x'' of possible inputs,
* a set Φ = { Φ<sub>1</sub>, ..., Φ<sub>''s''</sub> } of possible internal states,
* a set α = { α<sub>1</sub>, ..., α<sub>''r''</sub> } of possible outputs, or actions, with ''r'' ≤ ''s'',
* an initial state probability vector ''p''(0) = ≪ ''p''<sub>1</sub>(0), ..., ''p<sub>s</sub>''(0) ≫,
* a [[computable function]] ''A'' which after each time step ''t'' generates ''p''(''t'' + 1) from ''p''(''t''), the current input, and the current state, and
* a function ''G'': Φ → α which generates the output at each time step.
The states of such an automaton correspond to the states of a "discrete-state discrete-parameter [[Markov process]]".{{sfn|Narendra|Thathachar|1974|loc=p.325 left}} At each time step ''t'' = 0,1,2,3,..., the automaton reads an input from its environment, updates P(''t'') to P(''t'' + 1) by ''A'', randomly chooses a successor state according to the probabilities P(''t'' + 1) and outputs the corresponding action. The automaton's environment, in turn, reads the action and sends the next input to the automaton.<ref name="NarendraEtAl1989" />
 
===Category theoretic interpretation===
Other than the rewards, a Markov decision process <math>(S,A,P)</math> can be understood in terms of [[Category theory]]. Namely, let <math>\mathcal{A}</math> denote the [[free monoid]] with generating set ''A''. Let '''Dist''' denote the [[Kleisli category]] of the [http://ncatlab.org/nlab/show/Giry+monad Giry monad]. Then a functor <math>\mathcal{A}\to\mathbf{Dist}</math> encodes both the set ''S'' of states and the probability function ''P''.
 
In this way, Markov decision processes could be generalized from monoids (categories with one object) to arbitrary categories. One can call the result <math>(\mathcal{C}, F:\mathcal{C}\to \mathbf{Dist})</math> a ''context-dependent Markov decision process'', because moving from one object to another in <math>\mathcal{C}</math> changes the set of available actions and the set of possible states.{{Citation needed|reason=No reference is provided|date=December 2020}}
 
==Alternative notations==
Line 221 ⟶ 247:
In addition, transition probability is sometimes written <math>\Pr(s,a,s')</math>, <math>\Pr(s'\mid s,a)</math> or, rarely, <math>p_{s's}(a).</math>
 
== Constrained Markov decision processes ==
Constrained Markov decision processes (CMDPS) are extensions to Markov decision process (MDPs). There are three fundamental differences between MDPs and CMDPs.<ref>{{cite book|last=Altman|first=Eitan|title=Constrained Markov decision processes|volume=7|publisher=CRC Press|year=1999}}</ref>
 
* There are multiple costs incurred after applying an action instead of one.
* CMDPs are solved with [[Linear programming|linear programs]] only, and [[dynamic programming]] does not work.
* The final policy depends on the starting state.
 
The method of Lagrange multipliers applies to CMDPs.
Many Lagrangian-based algorithms have been developed.
* Natural policy gradient primal-dual method.<ref>
{{cite conference
| last1 = Ding | first1 =Dongsheng
| last2 = Zhang | first2 = Kaiqing
| last3 = Jovanovic | first3 = Mihailo
| last4 = Basar | first4 = Tamer
| year = 2020
| title = Natural policy gradient primal-dual method for constrained Markov decision processes
| conference = Advances in Neural Information Processing Systems
}}
</ref>
 
There are a number of applications for CMDPs. It has recently been used in [[motion planning]] scenarios in robotics.<ref>{{cite conference |last1=Feyzabadi |first1=S. |last2=Carpin |first2=S. |title=Risk-aware path planning using hierarchical constrained Markov Decision Processes |book-title=Automation Science and Engineering (CASE) |conference=IEEE International Conference |pages=297, 303 |date=18–22 Aug 2014 |url=https://www.researchgate.net/publication/270105954}}</ref>
 
==See also==
Line 258 ⟶ 262:
* [[Stochastic games]]
* [[Q-learning]]
* [[Markov chain]]
{{Div col end}}
 
==References==
{{Reflist}}
 
==Sources==
*{{citation|first=R.|last=Bellman|authorlink=Richard Bellman|year=1957|title=Dynamic Programming|publisher=Princeton University Press|isbn=978-0-486-42809-3}}. Dover paperback edition (2003)
 
==Further reading==
Line 274 ⟶ 282:
* {{cite book|last1=Sutton|first1=R. S.|last2=Barto|first2=A. G.|title=Reinforcement Learning: An Introduction|publisher=The MIT Press|___location=Cambridge, MA|year=2017|url=http://incompleteideas.net/sutton/book/the-book-2nd.html}}
* {{cite book|first=H.C.|last=Tijms.|title=A First Course in Stochastic Models|publisher=Wiley|year=2003|url=https://books.google.com/books?id=WibF8iVHaiMC|isbn=9780470864289}}
 
==External links==
* [http://www.eecs.umich.edu/~baveja/Papers/Thesis.ps.gz Learning to Solve Markovian Decision Processes] by [http://www.eecs.umich.edu/~baveja/ Satinder P. Singh]
 
[[Category:Optimal decisions]]