{'fraction_non_alphanumeric': 0.045188681375759356, 'fraction_numerical': 0.011878683859894762, 'mean_word_length': 4.400902549091352, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 9, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
A Convex Programming Approach to Data-Driven Risk-Averse Reinforcement Learning

This paper presents a model-free reinforcement learning (RL) algorithm to solve the risk-averse optimal control (RAOC) problem for discrete-time nonlinear systems. While successful RL algorithms have been presented to learn optimal control solutions under epistemic uncertainties (i.e., lack of knowledge of system dynamics), they do so by optimizing the expected utility of outcomes, which ignores the variance of cost under aleatory uncertainties (i.e., randomness). Performance-critical systems, however, must not only optimize the expected performance, but also reduce its variance to avoid performance fluctuation during RL's course of operation. To solve the RAOC problem, this paper presents the following three variants of RL algorithms and analyze their advantages and preferences for different situations/systems: 1) a one-shot static convex program -based RL, 2) an iterative value iteration (VI) algorithm that solves a linear programming (LP) optimization at each iteration, and 3) an iterative policy iteration (PI) algorithm that solves a convex optimization at each iteration and guarantees the stability of the consecutive control policies. Convergence of the exact optimization problems, which are infinite-dimensional in all three cases, to the optimal risk-averse value function is shown. To turn these optimization problems into standard optimization problems with finite decision variables and constraints, function approximation for value estimations as well as constraint sampling are leveraged. Data-driven implementations of these algorithms are provided based on Q-function which enables learning the optimal value without any knowledge of the system dynamics. The performance of the approximated solutions is also verified through a weighted sup-norm bound and the Lyapunov bound. A simulation example is provided to verify the effectiveness of the presented approach.


I. INTRODUCTION
M ANY next-generation autonomous control systems such as self-driving cars will be performance-critical systems for which an acceptable performance must be guaranteed throughout their course of operation. Guaranteeing performance in the presence of uncertainties, however, is challenging. There are generally two types of uncertainties that autonomous systems encounter: 1) epistemic uncertainties which occur due to the lack of data and can be reduced by collecting data (e.g., uncertain system dynamics), and 2) aleatory uncertainties due to randomness which are inherent in the system and cannot be reduced by data collection. Examples of aleatory uncertainties for a self-driving car could be sensors measurement noise, errors in perception due to weather, etc.
Classical optimal control methods achieve performance guarantee by optimizing the expected value of the objective function using a high-fidelity model of the system dynamics [1]- [5]. In the presence of epistemic uncertainty, a variety of adaptive dynamic programming (ADP) or reinforcement learning (RL) algorithms have been developed to learn the optimal expected value function and its corresponding control policy [5]- [10]. However, basing the design on optimizing expected value of outcomes and ignoring its variance due to aleatory uncertainties can result in high-variance controllers with performance fluctuation when deployed in real systems, which is not acceptable for performance-critical systems. Instead, to take into account aleatory uncertainties, the risk-averse optimal control (RAOC) problem has been widely considered to minimize not only the mean but also the variance of the performance or cost function. The term risk averse refers to the preference on choosing a more predictable outcome (i.e., less variance) with possibly lower expected value [11]- [16]. Therefore, to achieve long-term optimality as well as to avoid performance fluctuation, the RAOC problem has attracted a surge of interest [17]- [31]. Most existing risk-averse methods ignore the epistemic uncertainty and use a high-fidelity model of the system to design a risk-averse controller for systems under aleatory uncertainty. Complex systems such as self-driving cars are under both epistemic and aleatory certainties and it is of vital importance to learn online a solution to RAOC problem through interaction with the environment and without assuming that a high-fidelity model of the system exists.
RAOC problem has been presented in different settings. Specifically, value-at-risk criteria [20]- [32] has been widely used to formulate the RAOC problem as optimizing the expectation of the cost function while assuring that its variance is below an acceptable threshold. On the other hand, entropic risk measures leverage exponential cost functions to simultaneously optimize the average cost and its variance [33]- [34]. To account for epistemic uncertainties, policy gradient (PG) method [35], as an RL algorithm, has been leveraged to learn the solution to value-at-risk setting [36]- [39] and exponential utility setting [34]. PG algorithms explicitly parameterize the policy and update the control parameters in the direction of the gradient of the performance. However, generally, PG methods result in nonconvex optimization problems and thus converge to a local optimum rather than a global optimum. Moreover, PG method is sensitive to fixed gradient step size, an inappropriate choice of which can easily make it divergent. The authors in [40] formulated the RAOC problem as minimizing a cost-variance performance function and developed a data-driven RL algorithm for nonlinear stochastic systems. This method, however, requires solving coupled algebra Riccati equations, which are computationally expensive. Moreover, existing risk-averse learning approaches using RL require online interaction to collect data from the current policy, i.e, the samples are generated during the execution. However, in some applications, it is highly desired to turn a large dataset of samples that are collected in advance, and without further exploration, into powerful decisionmaking engines that minimize both the expected value of outcome and its variance.
In this paper, the following variants of RL algorithms are presented for solving the RAOC problem 1) a one-shot static convex program based RL algorithm is first developed that leverages past collected samples from the system under a variety of control policies and turns these samples into a decision-making machinery to make riskaverse decisions without requiring any online exploration. This is beneficial to many settings for which a large dataset of samples is available a priori and online interaction might be impractical, either because data collection is expensive or dangerous; 2) an iterative value iteration (VI) based RL algorithm is presented that solves a linear programming (LP) optimization at each iteration. Similar to the one-shot approach, it can leverage past collected data, but can also incorporate data collected from online interaction when a priori available data is not significant. A significant advantage of the VI algorithm is that it amounts to solving an LP optimization instead of a general convex optimization problem; and 3) an iterative policy iteration (PI) algorithm that solves a convex optimization problem at each iteration. The PI algorithm incorporates samples collected from online interaction and has the advantage of guaranteeing stochastic stability of consecutive control policies, when it starts from a stable control policy. The exact optimization problem is infinite dimensional in all three cases and their convergence to the optimal risk-averse value function is shown. To turn these optimization problems into standard optimization problems with finite decision variables and constraints, function approximation for value estimations as well as constraint sampling are leveraged, and data-driven implementations of these algorithms are provided based on Q-function. The performance of the approximated solutions is also verified through a weighted sup-norm bound and the Lyapunov bound. A simulation example is provided to verify the effectiveness of the presented approach.
The rest of this paper is organized as follows. In Section II, the problem formulation is given. A one-shot convex program for solving the RAOC problem is developed in Section III, and interactive LEE Bellman inequality-based VI and PI frameworks for the RAOC problem are presented in Section IV and V, respectively. Next, a simulation example is performed to verify the effectiveness of the proposed approach in Section VI. Finally, Section VII provides the conclusions.
Notation: Throughout this paper, we use R, R ≥0 , and N to denote the sets of real numbers, non-negativ real numbers, and non-negative integers, respectively. R n and R n×m denote the n dimensional real vector space, and the n × m real matrix space, respectively. For given variables x and y, x, y denotes the inner product of x and y. For a random variable X, E(X) denotes the expectation and Var(X) = E(X 2 ) − E(X) 2 refers the variance of X, respectively. exp(.) is an exponential operator such that exp(x) = e x . For convenience, E ξ refers the expectation over the random variable ξ . For a function g : X → R, the infinity norm, the weighted 1-norm, and the weighted infinity norm are defined as ||g|| ∞ = sup x∈X |g(x)|, ||g|| 1,c = X |g(x)|c(x)dx, and ||g|| ∞,c = sup x∈X c(x)|g(x)|, respectively. Definition 1. The L ∞ projection of set V 1 onto V 2 denoted as (1) Cauchy sequence of points in S (X) has a limit that is also in S (X).

II. PROBLEM FORMULATION
Consider the system described by the following stochastic nonlinear difference equation where x t ∈ X and u t ∈ U are the system's states and inputs, respectively, and f : X × U × E → X is the dynamics function.
The sets X and U are the admissible continuous state and action spaces, respectively. Moreover, {ε t ∈ E : t ∈ N} is a stochastic process defined on a complete probability space (Ω, F , Pr). A nonnegative cost L π for a fixed control policy π : X → U is given by where l(.) is a positive definite function and R is a positive definite symmetric matrix and γ ∈ (0, 1] is a discounted factor. Hereafter, the subscript t may be dropped for notational simplicity. The infinitehorizon risk-averse cost function J can be formulated as where α ∈ R >0 is the risk-averse factor. The following result has been widely used in the literature which shows that the exponential cost function (3) takes into account not only the expected value but also the variance of the cost (3). The proof is provided in the appendix for the sake of completeness.
Lemma 1: Consider the infinite-horizon risk-averse cost function J given in (4). Then, Lemma 2: The risk-averse cost function (5) is continuous, nondecreasing, and convex. proof. See [44]. Remark 1. Note that compared with the traditional expected cost criteria, the risk-averse objective takes the variance into consideration and the trade-off between the expectation and the variance is achieved by an appropriate selection of the risk factor α.
We now formally state the risk-averse optimal control (RAOC) problem as follows.
Problem 1. Design an optimal control policy π * : X → U that minimizes the cost function (4). That is, find π * that solves where Π is the set of admissible policies. For a given policy π, defining the value function as the following log-expected-exponential (LEE) Bellman equation is obtained [46] V π (x) = l(x) + π(x) T R π(x) + 1 [exp(αγV π (x π(x) ))]) (8) where, in general, x u is the realization of the next state starting from the state x and applying the action u. The method that is classically implemented to solve the RAOC problem is dynamic programming (DP). DP optimality condition for the optimal value function gives the following optimal LEE Bellman equation After solving (9) for V * , the optimal controller becomes π * (x) = arg min For the convenience of analysis, (9) can be expressed in the form of an operator T as with where T is the optimal LEE Bellman operator, called optimal risk Bellman operator, mapping from the space of risk averse objective functions to itself.
A. Q-function formulation for LEE Bellman equation The LEE Bellman equation (8) computes the value of each state for any admissible control policy π. Alternatively, to compute the value of each state-action pair (x, u), the Q-function associated to control policy π is defined as Comparing equations (8) and (13), one has V π (x) = Q π (x, u). Defining the optimal Q-function Q * (x, u) := Q π * (x, u) gives with the optimal control policy given by Note that Substituting (16) into (14), (14) can be expressed in the form of the optimal Q risk Bellman operator F as with where u denotes the next action under the optimal policy π * . Note that the operators defined in (12) and (18) are nonlinear operators. In the next subsection, instead of directly solving the optimal LEE Bellman operator (12) or (18), easier-to-solve operators are introduced to be iterated on.

B. LEE Bellman operator and Optimal LEE Bellman operator Properties
Based on (8), consider the LEE Bellman operator introduced below.
where u = π(x). Although the LEE Bellman operator in (19) is easier to solve than (12) since the infimum operation is removed, it is still a nonlinear operator, in contrast to the risk-neutral Bellman operator case, because of the nonlinearity of the exponential utility. Therefore, classical RL algorithms such as VI and PI algorithms based on temporal difference error minimization, which significantly relies on the linearity of Bellman equations, cannot be applied to solve the RAOC problem. This paper obviates this issue by formulating the RAOC problem as convex programs in general and linear program in a special case. Several properties of (19) are investigated in this subsection, which are crucial to developing risk-averse RL algorithms for the RAOC problem in the next section.
It is shown in the following propositions that the LEE Bellman operatorT and the optimal LEE Bellman operator T given in (19) and (12), respectively, are monotone and contractive operators. Definition 3. [41], [42] Let S (X) be a complete space. An operator T : S (X) → S (X) is monotone if Proposition 1: (Monotonicity property) The LEE Bellman oper-atorT in (19) and the optimal Bellman operator T in (12) are monotone.
Proof. To show the monotonicity property forT , one needs to show that for any V π 1 (x) and Consider now two functions V π 1 ,V π 2 ∈ S (X ). Using the fact that ln(.) and exp(.) are injective relations (i.e., one-to-one and left-total), and E(.) is also injective relation over the set of strictly increasing functions, it follows from Adding l(x) + u T Ru to both sides of this equation yields which satisfies the condition of Definition 3. This completes the proof.
Before proceeding further, the following definition and assumption are needed.

Definition 4.
[43] Let X be a finite-dimensional vector space. Considering a weight function w : X → R such that w(x) > 0, ∀x ∈ X , the weighted sup-norm is defined as Assumption 1. There exists a constant ρ ≥ 0 and a non-decreasing for some constant ∆ ∈ (0, 1 γ ). Theorem 1: (Contraction property) Let Assumption 1 hold. The Bellman operator in (19) and the optimal Bellman operator in (12) are contraction mappings with respect to the weighted norm w. That is, and Remark 2. Note that if the stage cost or reward function l(x) + u T Ru is bounded, then the weighted sup-norm becomes the ∞ -norm and the contraction mapping is satisfied for ∞-norm. The weighted supnorm contraction, however, captures a more general case for which the reward is only needed to be bounded by a function of the state. If the stage cost is not bounded, the ∞-norm might be unbounded. Proposition 2: Let V 0 be an arbitrary value function. Then, the following properties hold. 1) for the LEE Bellman operator (19) when the actions are generated by a fixed policy π, i.e., u = π(x).

2)
for the LEE optimal Bellman operator (12). Proof. Based on Proposition 1 and Theorem 1, the LEE Bellman operator and the optimal LEE Bellman operator are shown to have properties of monotonicity and contraction. Observing these facts, the result follows by invoking Banach's theorem [45] which implies that there are unique fixed-point solutions V π and V * of the operators. This completes the proof.
Proposition 3: A value function V that satisfies the Bellman inequality V ≤T V provides a lower bound to V π . Moreover, a value function V that satisfies the optimal Bellman inequality V ≤ T V provides a lower bound to V * . Proof. Considering V ≤T V and applying the operatorT on its both sides repeatedly, and using the results of Proposition 2 yields The same argument can be used also to show that V ≤ T V provides a lower bound to V * . This completes the proof.
The main goal of the RAOC problem is to find the optimal control policy π * that optimizes the risk-averse cost function (4), which is generally computationally intractable. To sidestep the computational complexity, three RL algorithms are developed in the next section based on different learning processes 1) one-shot static convex optimization, 2) iterative value iteration (VI) algorithm that solves an LP optimization at each iteration, and 3) iterative policy iteration algorithm (PI) that solves a convex optimization at each iteration. The convergence of the solution of all three algorithms to the solution of (12) or equivalently (18) is shown. The performance of the proposed algorithms is also verified through a weighted sup-norm bound and the Lyapunov bound. Based on the analysis of the properties, datadriven implementations of these algorithms are provided based on Q-function which enables learning the optimal value without any knowledge of the system dynamics.

III. ONE-SHOT CONVEX PROGRAM FOR SOLVING THE RAOC PROBLEM
A. One-shot infinite-dimensional convex program The following one-shot optimization algorithm is presented for solving the RAOC problem and its convergence to the fixed point of T operator (12) is also shown.
where the state-importance weighting c(.) is a finite measure on X that assigns positive weights to all open subsets of X . Note that while the operatorT is used in this optimization problem, since the constraints must be satisfied for all actions u ∈ U , they are also satisfied for the infimum of u as well, which means that it also satisfies the operator T . Since the maximization finds the best lower bound for all value functions that satisfy the inequality, the optimal value function is the unique solution of this optimization.
The following corollary provides a formal proof for this claim.
Corollary 1: The solution to the optimization problem (32) coincides with the optimal value function V * .
proof. Recall that ∀(x, u) ∈ X × U . This implies that V * is a feasible solution to (32). Also, for any V ∈ S (X ) in a feasible region of (32), the inequality holds for all (x, u) ∈ X × U , which implies that it also holds for specific u ∈ U that minimizes V (x u ). That is, it also satisfies T operator, i.e, V (x) ≤ T V (x). Based on Proposition 3, this indicates that V is a lower bound to V * . Since the objective function in (32) is maximized over the space of value functions, V * as the best lower bound, is the solution of the optimization. Based on Lemma 2, the constraint set is convex and since the objective function is linear in the decision variables, Problem 2 is a convex optimization problem. This optimization problem, however, is an infinite-dimensional convex optimization problem since there are infinite-decision variables and infinite number of samples. The following subsections resolve this issue by first restricting the value function in the space of a finite family of basis functions and then sampling the constraints.

B. One-shot semi-infinite-dimensional convex program
In order to overcome the computational complexity of the infinitedimensional state space in the optimization problem (32), the value function is restricted in the span of a finite family of basis functions asŜ where v i : X → R is the finite family of basis functions of the value function and {h 1 , ..., h N } are the basis functions weights. The optimal risk-averse value function is assumed to be located in the span of the approximate space, and there is a trade-off between the computational complexity and quality of the approximation.
Note that the number of decision variables is now finite (i.e, the size of the weight vector h = [h 1 , ..., h N ]), but the number of constraints is still infinite, which makes the optimization problem a semi-infinite convex program.
The following lemma shows that Problem 3 results in the minimization of a certain weighted norm, which suggests that the weights c(x) impose a trade-off in the quality of the value function approximation across states.
To investigate the performance bound of the proposed scheme for the RAOC problem, inspired by [47], [49], [50], which performed the analysis on LP-based risk-neutral approximate dynamic programming, the error bounds due to approximating the risk-averse value function (i.e., the approximation error) are now investigated. In contrast to [47], [49], [53], however, weighted sup-norm is used in our analysis, because of the weighted sup-norm contraction results for risk-averse case in Theorem 1. The optimal value function found by the exact optimization (32) (called V * here) is now compared with the value function solution to the optimization Problem 3. Let V P be the projection of V * onŜ (X ). Even if the basis functions are chosen such that their span is relatively close to V * (i.e., ||V * −V P | w is small), the approximate value function found by solving Problem 3 (calledV * here) might not be close to V * in general.
Theorem 2: (weighted sup-norm bound) LetV * be the approximate value function solution to (36), and V * be the solution to (9). Then, Proof. See Appendix D.
Before proceeding to the Lyapunov bound analysis, the following lemmas and definition are required. Definition 4. M operator is defined as follows which implies the worst case of the future risk-averse value function. Moreover, based on (39), the Lyapunov function V is defined as the one whose Lyapunov factor Θ V satisfies the following condition Lemma 4: For any g 1 (x), g 2 (x) : X → R, the following holds Then, V is a solution to (36), i.e., V ≤T V .
Proof : See Appendix G.
Theorem 3: (Lyapunov bound) Let V * be the solution to (9), and V * be the solution to (36). IfV + > 0 satisfies γMV + <V + , then Proof. See Appendix H. An advantage of this Lyapunov bound over the weighted sup-norm bound is that a mechanism for selection of the relevance weighting, which is showed up in the right-hand side of the Lyapunov bound, can be devised.

C. Model-free one-shot standard convex program
To provide tractable standard convex programs for solving the oneshot optimization problem (with a finite number of decision variables and samples), a sampling-based one-shot algorithm is now presented. While a sample-based standard convex optimization algorithm can be developed by sampling constraints from the optimization Problem 3, it would result in a model-based greedy policy learning. That is, after finding the approximate optimal value functionV * from solving sampled-based version of Problem 3, finding the greedy approximate optimal control policy by solvinĝ requires the complete knowledge of the system dynamics. However, since the convergence properties of Problem 1 and performance bounds for Problem 3 also hold ifT operator is replaced witĥ F operator, one can replace value-based equation (36) with the following optimization based on Q function Similar to the value function approximation, the space of Q-functions is also limited to a set of basis functions defined aŝ where q i : X × U → R is the finite family of basis functions of the Q-functions, with β = {β 1 , β 2 , ..., β N } as the weights. The optimal risk-averse Q-function is assumed to be located in the span of the approximate space, and there is a trade-off between the computational complexity and quality of the approximation. Note that the approximate quality relies on several factors (e.g., the number of basis functions, weighting factor c(.)), and the optimal solution Q * is assumed to be in the span of the approximate spaceŜ (X , U ). The details of data collection and implementation of this data-based algorithm are postponed to Section V. A since Algorithm 1 and Algorithms 3 and 4 that will be presented later for VI and PI have the same data collection strategies. Algorithm 1 uses this optimization for a model-free implementation of the one-shot optimization.
Algorithm 1 One-shot sample-based standard convex optimization algorithm.
Result: The optimal risk-averse objective functionQ * . Input: The basis functions; the noise κ in control input u and the noise υ in state x; the number of sample tuples N, Z and number of control policy O.
1: Data collection: Select different control policies π = {π 1 , π 2 , ..., π o }. For each control policy π o ∈ π, generate state- randomly with noise κ and υ in the control input π o and state x where (x LettingQ be the solution to Algorithm 1, the model-free greedy policy is found by Remark 3. Note that a significant advantage of this algorithm is that the samples can be collected in advance and no online interaction or consecutive samples are required to be collected, which provides a machinery to turn large data sets into decision-making mechanisms. This algorithm, however, requires solving a convex optimization problem. The next section shows how an iterative VI algorithm can be leveraged to solve an LP optimization at each iteration.

IV. INTERACTIVE LEE BELLMAN INEQUALITY BASED VI
FRAMEWORK.
Recalling T operator developed in (12), the following VI algorithm solves an LP optimization at each iteration.

Proposition 4: The solution for (50) is the solution to the following dynamic recursion involving value function
Proof. Let J * be the solution to (51) and assume that there exists a subspace B c ∈ X such that ∀x ∈ B c , J * ( which is an infinite-dimensional linear optimization problem both in cost and constraints over the infinite-dimensional space of V k+1 and with infinite number of constraints. Proposition 5: Given an admissible initial value function V 0 , the interactive problem (50) converges to optimal value V * . Proof. The proof follows Proposition 4. Since VI algorithm implement T operator in each iteration, the sequence {V 0 ,V 1 , ...V n } converges to the fixed-point solution V * . This completes the proof.
Remark 4. Note that even though the risk-averse cost function is convex, the VI algorithm uses a recursive inequality for which in its right-hand side the decision variables from the previous iteration are used (which are known), and thus inequalities are linear in decision variables (which appear in the left-hand side of inequalities).
Based on (52), the data-driven VI algorithm with finite-dimensional LP is now developed. Using a similar terminology used for one-shot optimization, Q-function approximation and Q-Bellman operator are used instead of value function approximation to provide a modelfree data-based implementation. Algorithm 2 provides the details of sampling-based model-free Q-learning VI algorithm.

Algorithm 2 Data-driven sample-based standard LP-based iterative VI algorithm.
Result: The optimal risk-averse objective functionQ * =Q N . Input: Basis centers {c 1 , c 2 , ...c M } and basis functions, the noise κ in control input u and the noise υ in state x; the number of sample tuples N, Z and number of control policy O; the initial value functionQ 0 and threshold value ξ . Data Collection: Select different control policies π = {π 1 , π 2 , ..., π o }. For each control policy π o ∈ π, generate state-action randomly with noise κ and υ in the control input π o and state x where Measure the state x s ∈ X Sample N s points u s uniformly from U for all u s do Evaluate b(u s ) =FQ N (x s , u s ) end Calculate u N = arg min u s b(u s ) Apply u N to the system.

Remark 5.
Notice that Algorithm 2 solves the RAOC problem in a recursive way. With the initial value function and sampling data, the improved value functions {V 1 ,V 2 , ...V n } are computed successively.

V. PI ALGORITHM FOR SOLVING RAOC PROBLEM
In this section, a convex-program-based PI algorithm is presented for solving the RAOC problem. The risk-averse PI algorithm relies on the policy evaluation step that leverages the LEE Bellman inequality to evaluate the value function corresponding to a control policy and the policy improvement step that finds an improved policy at each iteration. The implementation of PI using a convex program is discussed in Section V.A.
The policy evaluation step is formulated as follows.
Problem 5. (Infinite-dimensional convex program for policy evaluation) For a fixed control policy u = π(x), solve whereT is defined in (19).

Proposition 6:
The solution to (54) is equivalent to the solution to (13), and is the fixed-point solution of (19).
Proof. Based on Proposition 3, any feasible solution of (54) satisfies V ≤ V π . Therefore, maximization in (54) finds the best lower bound, and thus V π is the unique solution to this optimization, which is also the fixed point of (19) as shown in Proposition 2. This completes the proof.
Remark 6. Note that the feasible region in (54) can be enlarged by applying iterativelyT operator inequality. A value function satisfying V ≤T M V with M ∈ R is an under-estimator of V π . Notice that the constraint in (54) is a special case when M = 1 and without loss of generality, M is set to 1 in the sequel. It follows from Proposition 2 thatT M V M→∞ − −−− → V π which also establishes the following program Remark 7. The difference between the optimization (54) and optimization (32) is that the control actions u are relaxed in the constraints of (32) and can be chosen arbitrary and does not need to follow any specific policy, while the control actions in (54) follow the policy under evaluation.
Based on the finite approximation of the value function space (35), an approximation version of (54) is formulated as Problem 6.
Proof. The proof is similar to that of Lemma 3 and only the operator T in Lemma 3 is now replaced by the operatorT and thus V * is replaced by V π in the poof of Lemma 3.
Given the value function V approximated from (54) or (32), the corresponding improved control policy or optimal control policy could be computed bŷ which requires the dynamic knowledge of the system. The following model-based algorithm is presented based on value function learning. A Q-function-based version of the value estimation is presented later to obviate the requirement of the system dynamics while only leveraging the samples collected from the experiments or simulations.
Algorithm 3 Model-based PI algorithm. Until convergence, repeat the following steps: 1: Policy evaluation step: For the policy π i , solve forV π i using 2: Policy improvement step: Update the control policy π i+1 as: Then, for any initial condition x 0 ∈ P λ , x(t) converges to the origin with a probability of at least P(V (x), λ ) : Proof. See [56].
Theorem 4: Let the control policies and value functions obtained from the iterative PI Algorithm 3 at iteration i be π i and V π i , respectively, and γ = 1. Then, if π 1 is asymptotically stable, for any initial condition x 0 ∈ P λ (V π i , λ ), the control policy π i for i = 2, 3, ... are also asymptotically stabilizable with a probability at least P(V π i , λ ). Proof. Proposition 4 shows that for a given policy the policy evaluation step (59) is equivalent to the Bellman operator. To show that π i+1 is stabilizing, we consider the value function V π i as a Lyapunov candidate function. Before proceeding, note that using Jensen inequality [54] for the Bellman equation (8), one has Then, where the first inequality is obtained from (61) and the second inequality is obtained based on the facts that l(x) + π i (x) T R π i (x) ≥ 0 and the value function improves at every iteration (i.e., . Therefore, based on Lemma 8 one can conclude that for any initial condition x 0 ∈ P λ (V π i , λ ), the control policy π i for i = 2, 3, ... are also asymptotically stabilizable with probability at least P(V π i , λ ).
The following Proposition shows convergence of infinitedimensional PI algorithm to the optimal policy when no function approximation is used in Algorithm 3. For the semi-infinite PI with function approximation, Theorems 5 and 6 provide the performance bounds for the case where function approximation is used.
Proposition 7: Algorithm 3 converges to the unique optimal solution, which is the fixed point of T in (12) for the infinite-dimensional PI.
Proof. We first show that V π i+1 ≤ V π i . Based on the policy improvement step, one has ) ))])])]) Therefore, one has V π 1 ≥ V π 2 ≥ ... ≥ V π n , i.e., the sequence is decreasing, and since the value functions are also bounded, it converges. On convergence, V π n = V π n+1 = V π * = V * . Since π n+1 is the greedy policy solved from V π using (60), the following holds which is optimal LEE Bellman equation (12). Since π n+1 satisfies LEE Bellman optimal equation (12), π n+1 = π * holds, meaning that both π n and π n+1 are optimal policies. In other words, policy improvement yields a strictly better policy unless the original policy is already optimal. This completes the proof. Theorem 5: (weighted sup-norm bound) LetV π i be an approximate value function solution to (59), V π i be the solution to (65) and V π i P be the weighted sup-norm projection of V π i onŜ . Then, Proof. The proof is similar to that of Theorem 2, and only the operator T in Theorem 2 is now replaced by the operatorT and thus V * is replaced by V π in the poof of Lemma 3. Theorem 6: (Lyapunov bound) Let V π i be the solution to the LEE Bellman equation (19) for policy π i , andV π i be the approximate solution to (59). IfV + > 0 satisfies γMV + <V + , then Proof. The proof is similar to that of Theorem 3, and is omitted due to the limited space. Based on the model-based PI algorithm, a model-free PI algorithm is now presented utilizing the Q-function. Algorithm 4 uses Algorithm 3 and the relationship between V and Q-functions, i.e., V π (x) = Q π (x, π(x)) to develop a model-free Q-based PI algorithm.
In the next subsection, details of developing a data-driven PI algorithm for the RAOC problem using sampling data are presented and provided by Algorithm 4.

A. Data-driven implementation of PI for the RAOC problem
The main goal is to estimate the optimal risk-averse objective functionQ π in each iteration. To this aim, consider the following optimization problem. Problem 7. (Approximate space Q-based policy evaluation) In order to incorporate the prior knowledge on the learning process, (68) can be reformulated as The difference between (68) and (69) is that u i ∈ U is fixed to be the improved control policy π k found from the last iteration in (69) while in (68) u i ∈ U provides certain freedom in exploring different control policies. It should be noted that (69) can be regarded as a special case of (68). In addition, the tuple (x i , u i , x u i , l(x i )) can be reused with adding different u i . Noting the fact that (68) and (69) contain expectation with respect to the next state of x i , empirical method [55] can be employed using sampling in algorithm. To this end, (69) can be reformulated as where x i are i.i.d. samples collected at the next state of x i given u i . Similar to [51], one effective way for guaranteeing the nonincreasing risk-averse objective function is keeping all constraints from previous iterations. To alleviate the computational burden, a surrogate strategy is to only keep binding constraints from iteration k for the next iteration k +1. The binding constraints refer to constraints with nonzero optimal Lagrange multipliers [52] for which their removal affects the optimal value of the convex programming. The following proposition is inspired by [51].
Proposition 8: Suppose that the risk-averse objective function in Algorithm 4 is finite for k = 1. Then, the risk-averse value functions learned by Algorithm 4 are monotonically non-increasing. Proof. The optimization constraints in the iteration k + 1 includes the binding constraints Ξ k from the k-th iteration. Therefore, along with additional constraints, the sequence of value functions found by the optimization problem cannot increase. This completes the proof. Remark 8. The sample trajectories of the system are assumed to be available in advance and can either come from historical data or from a generative model of the system. The value function is to be approximated with a buffer consisting of several disposal statecontrol-successor triples (x .., M} is the experiment number. The proposed approach will allow learning an unbiased and low-variance control policy using previously collected data from the system, which is of vital importance for systems that exploration and online interaction is risky for.
The Data-driven Q-based PI algorithm is summarized in Algorithm 4.
Algorithm 4 Data-driven Q-based PI algorithm.
Input: Parameters , ϖ, Q ∈ R, basis functions {q i } ϖ i=1 , an initial policy π 1 , and threshold value ξ Set k = 1 and Ξ 0 = / 0 while Q i −Q i−1 ≥ ξ do for q = 1, ..., Q do Collect x q ∈ X , apply u q ∈ U , observe the next state of x q , x u q , and l q ∈ R >0 end for i = 1, ..., do Select Remark 9. The summarized Algorithm 4 can be regarded as an actorcritic structure for optimal risk-averse value function approximation. The critic estimates theQ π i in each iteration which is followed by a greedy actor to improve control policy. Since the function space is restricted on (35) so the improved control policy can be calculated efficiently. Notice that the number of constraints in (71) is bounded by a finite number. Q data tuples drawn from the experiment and the number of derived constraints is N. To accelerate the convergence of the algorithm without extra computational burden, the binding constraints from the last iteration k are included as additional constraints in the LP solved in iteration k + 1. The total number of the binding constraints is assumed to be bounded.
Note that for the policy evaluation step, while samples are collected from the current policy to form the optimization constraints, the optimization can still use previous samples, and, if the sample set is large enough, it will also include samples from the current policy.

VI. NUMERICAL RESULTS
The efficiency of the proposed algorithm is verified using a one dimensional LQG numerical example from [55] with linear dynamics given by    σ = 1. That is, the process ε t has a distribution density given by where φ (.) and Φ(.) are, respectively, probability density functions of the standard normal distribution and its cumulative distribution function. To approximate value functions, Fourier basis functions are used in the simulation as 10 π cos πs 10 , 5 π sin πs 5 , 10 3π cos 3πs 10 , 5 2π sin 2πs 5 .
The uniform distribution on X × U = [−10, 10] × [−10, 10] is used to generate the random samples. Fig. 1 shows the actual performance as a function of number of samples for α = 5. One can observe that using at least 9e 4 sampled constraints the proposed approach can reach the optimal performance function J * with an acceptable approximation accuracy. Note that the blue dotted line in Fig. 1 is the optimal solution J * approximated by n = 10 (number of basis functions) and N = 1e 7 (number of sampled constraints). Moreover, the shaded area and dashed line represent the results between [10%, 90%] quantiles and the means across 100 independent experiments. One can see from Fig. 1 that by choosing a greater number for sampled constraints the variance of the approximation will be diminished significantly. Fig. 2 shows the performance of Algorithm 1 for the risk-neutral case (i.e., α = 0), in which we aim to minimize the expectation of the quadratic cost function (3), i.e., J = E[L π ]. Note that the blue dotted line in Fig. 2 is the optimal solution J * approximated by n = 10 (number of basis functions) and N = 1e 4 (number of sampled constraints). Moreover, the shaded area and dashed line represent the results between [10%, 90%] quantiles and the means across 100 independent experiments. The trajectories of state for both risk-neutral and riskaverse cases are displayed in Fig. 3. Note that the variance of the performance is lower for the risk-averse case as expected. If fact, in the risk-averse case (i.e., α > 0), control acts as if the process ε t directed the state in an undesired direction, and therefore it tries to reduce the effects of the process ε t on state x t through minimizing the expected value and the variance of the cost (3).

VII. CONCLUSION
In this paper, three model-free reinforcement learning (RL) algorithms are developed to solve the risk-averse optimal control (RAOC) problem for discrete-time nonlinear systems. The first algorithm turns the learning process of finding a control policy into a one-shot convex optimization problem using only a large dataset of a priori collected samples. For the cases where online interaction is also necessary because rich data samples are not available a priori, iterative VI and PI-based RL algorithms are presented to learn the solution to the RAOC problem. The advantage of the VI algorithm is that it solves an LP optimization at each iteration and the advantage of the PI algorithm is that it guarantees stability of learned control policies. Convergence of the presented data-based algorithms to the optimal solution is shown for the exact convex program-based algorithms, which are infinite dimensional, and the approximate error bounds due to function approximation and constraint sampling for the resulting standard convex optimization algorithms are found. A simulation example is provided to validate the theoretical results. The future work is to provide sample complexity analysis for data-based algorithms and for the stability guarantee of the PI algorithm.
where the second inequality follows from (76), the third inequality from ln E[ f (x)+g(x)] ≥ E( f (x))+E(g(x)), the fourth inequality from from Jensen's inequality and the last one from Assumption 1. By changing the roles of V π 1 with V π 2 we obtain (27). This completes the proof.

APPENDIX III PROOF OF LEMMA 3
Corollary 1 showed that any feasible solution of the optimization Problem 3 satisfies the optimal LEE Bellman operatorV ≤ TV . Based on Propositions 1 and 1, the optimal LEE Bellman operator is monotone and contracting with a fixed-point solution V * . Therefore, for anyV ≤ TV , one haŝ It follows from (78) that Therefore, maximizing the XV (x)c(x)dx (which is (36)) equals to minimizing ||V * −V || 1,c(x) . This completes the proof.

APPENDIX IV PROOF OF THEOREM 2
Based on Proposition 1, the operatorT is contraction map, and therefore, the following inequality holds ||V * −T V P || w = ||T V * −T V P || w ≤ ∆γ ||V * −V P || w Based on (80), the following inequalities hold ∆γ ||V * −V P || w ≥ V * − T V P w(x) ≥ −∆γ ||V * − T V P || w which results in Then, defineV ∈ S aŝ Then,V also satisfiesV ≤ TV since the second term of right-hand side is a downwards shift term and the approximate space S allows for affine combinations of basis functions. Based on (82) and (83), the following holds whereV * is the solution to (36). This completes the proof.

APPENDIX VI PROOF OF LEMMA 5
For any J(.) > 0 and any V (.), the following holds This completes the proof.

APPENDIX VII PROOF OF LEMMA 6
It follows from (43) that Using (89) and (90), the following inequality holds Since V L is the Lyapunov function, the following equality holds Plugging (92) where V L is the Lyapunov function such that γMV L < V L holds. Based on Lemma 6, is a feasible solution for (36), therefore, taking the infinite norm of V −V * yields then, Substituting (95) into (94), (44) holds.