### 机器学习代写|强化学习project代写reinforence learning代考|Bellman Equation and Temporal Differences

statistics-lab™ 为您的留学生涯保驾护航 在代写强化学习reinforence learning方面已经树立了自己的口碑, 保证靠谱, 高质且原创的统计Statistics代写服务。我们的专家在代写强化学习reinforence learning代写方面经验极为丰富，各种代写强化学习reinforence learning相关的作业也就用不着说。

• Statistical Inference 统计推断
• Statistical Computing 统计计算
• (Generalized) Linear Models 广义线性模型
• Statistical Machine Learning 统计机器学习
• Longitudinal Data Analysis 纵向数据分析
• Foundations of Data Science 数据科学基础

## 机器学习代写|强化学习project代写reinforence learning代考|Bellman Equation and Temporal Differences

As an alternative to MC estimates, we can make use of the Bellman equation, that expresses a value function in a recursive way

$$v_{\pi}(s)=\mathbb{E}{\mathcal{P}, \pi}\left[r\left(s{t}, a_{t}\right)+\gamma v_{\pi}\left(s_{t+1}\right) \mid s_{t}=s .\right]$$
For any arbitrary value function, the mean squared error can be reformulated using the Bellman equation. That results in the mean squared Bellman error objective
$$\overline{\mathrm{BE}}(\theta)=\mathbb{E}{\mu}\left[\left(\hat{v}{\theta}(s)-\mathbb{E}{\mathcal{P}, \pi}\left[r\left(s{t}, a_{t}\right)+\gamma \hat{v}{\theta}\left(s{t+1}\right) \mid \pi, s_{t}=s\right]\right)^{2}\right] .$$
Again no parametric value function can achieve $\overline{\mathrm{BE}}(\theta)=0$, because then it would be identical to $v_{\pi}$, what is not possible for non-trivial value functions. The mean squared Bellman error can be simplified to $\overline{\mathrm{BE}}(\theta)=\mathbb{E}{\mu}\left[\left(\mathbb{E}{\mathcal{P}{, \pi}}\left[\delta{t} \mid s_{t}\right]\right)^{2}\right]$, where $\delta_{t}$ refers to the temporal-difference (TD) error
$$\delta_{t}=r\left(s_{t}, a_{t}\right)+\gamma \hat{v}{\theta}\left(s{t+1}\right)-\hat{v}{\theta}\left(s{t}\right) .$$
Taking a closer look at the simplified mean squared Bellman error points out the so called double sampling problem. The outer expectation value is taken concerning the multiplication of a random variable with itself. To get an unbiased estimator for the product of two random variables, two independently generated sample from the corresponding distribution are necessary. In case of the mean squared Bellman error that means, that for one state $s_{t}$, two successor states $s_{t+1}$ needs to be sampled independently. In most Reinforcement Learning settings, sampling such two successor states independently is not possible. Special cases overcoming the double sampling problem, e.g. cases, in which a model of the MDP is available or in which the MDP is deterministic, are usually less relevant in practice $[1,11]$.

In practice we often want to learn from experience, collected during single trajectories. Consequently only one successor state per state is available. When only using a single successor state for calculating the estimation value, the square of the mean squared Bellman error moves into the inner expectation value. The resulting formula is referred to as the mean squared temporal-difference error
\begin{aligned} \overline{\operatorname{TDE}}(\theta) &=\mathbb{E}{\mu}\left[\mathbb{E}{\mathcal{P}, \pi}\left[\delta_{t}^{2} \mid s_{t}\right]\right] \ &=\mathbb{E}{\mu}\left[\hat{v}{\theta}(s)-\mathbb{E}{\mathcal{P}, \pi}\left[\left(r\left(s{t}, a_{t}\right)+\gamma \hat{v}{\theta}\left(s{t+1}\right)\right)^{2} \mid \pi, s_{t}=s\right]\right] . \end{aligned}
The objectives of the mean squared temporal-difference error and the mean squared Bellman error differ and result in different approximate parametric value functions. Furthermore a parametric value function can now achieve $\overline{\mathrm{TDE}}(\theta)=0[3,11]$.
One last alternative to the stated objective functions is the mean squared projected Bellman error. It is related to the mean squared Bellman error. When constructing the mean squared Bellman error objective, first the Bellman operator is applied to the approximation function. In a second step the weighted estimation value of the difference between the resulting function and the approximation function is constructed. When defining the Bellman operator as $\left(B_{\pi} v_{\pi}\right)\left(s_{t}\right)=$

$\mathbb{E}{\mathcal{P}, \pi}\left[r\left(s{t}, a_{t}\right)+\gamma v_{\pi}\left(s_{t+1}\right) \mid \pi, s_{t}=s\right]$, the mean squared Bellman error can be rewritten as $\overline{\mathrm{BE}}(\theta)=\mathbb{E}{\mu}\left[\left(\hat{v}{\theta}(s)-\leftB_{\pi} \hat{v}{\theta}\right\right)^{2}\right]$. However often $\left(B{\pi} v_{\pi}\right)(s) \notin \mathcal{H}{\theta}$. But using the projection operator $\Pi,\left(B{\pi} v_{\pi}\right)(s)$ can be projected back into $\mathcal{H}{\theta}$. That results in the mean squared projected Bellman error $$\overline{\operatorname{PBE}}(\theta)=\mathbb{E}{\mu}\left[\left(\hat{v}{\theta}(s)-\left\Pi\left(B{\pi} \hat{v}{\theta}\right)\right\right)^{2}\right]$$ Analogous to the mean squared temporal-difference error, approximate value functions can achieve $\overline{\mathrm{PBE}}(\theta)=0$. It is important to mention, that the optimization of all mentioned objective functions in general results in different approximation functions, i.e. $$\begin{gathered} \arg \min {\theta} \overline{\mathrm{VE}}(\theta) \neq \arg \min {\theta} \overline{\mathrm{BE}}(\theta) \ \neq \arg \min {\theta} \overline{\mathrm{TDE}}(\theta) \neq \arg \min {\theta} \overline{\mathrm{PBE}}(\theta) . \end{gathered}$$ Only when $v{\pi} \in \mathcal{H}{\theta}$, then methods optimizing the $\overline{\mathrm{BE}}$ and the $\overline{\mathrm{PBE}}$ as an objective converge to the same and true value function $v{\pi}$, i.e. $\arg \min {\theta} \overline{\mathrm{VE}}(\theta)=\arg \min {\theta}$ $\overline{\mathrm{BE}}(\theta)=\operatorname{arg~min}_{\theta} \overline{\mathrm{PBE}}(\theta)[3,8,11]$.

## 机器学习代写|强化学习project代写reinforence learning代考|Error Sources of Policy Evaluation Methods

Three general, conceptual error sources of Policy Evaluation methods result from the previous explanations [3]:

• Objective bias: The minimum of the objective function often does not correspond with the minimum of the mean squared error, e.g. arg $\min {\theta} \overline{\mathrm{VE}} \neq$ $\arg {\min }^{\theta}$
• Sampling error: Since it is impossible to collect samples over the whole state set $\mathcal{S}$, learning the approximation function has to be done using only a limited number of samples.
• Optimization error: Optimization errors occur, when the chosen optimization methods does not find the (global) optimum, e.g. due to non-convexity of the objective function.

When trying to learn the value function of a target policy $\pi$ using samples collected by a behavior policy $b$, commonly referred to as off-policy learning, two main problems occur. First, the probability of a trajectory occurring after visiting a certain state might be different for $b$ and $\pi$. As a result the probability for the observed cumulative discounted reward might be different and more or less relevant for the

estimation of the true value of the state. This problem can easily be solved using importance sampling. As the stated objectives in this paper all make use of temporal differences, importance sampling simplifies to weighting only as many steps as used for bootstrapping.

The second problem occurs, because the stationary distributions for behavior policy $b$ and target policy $\pi$ differ, i.e. $d^{b}(s) \neq \mu(s)$. This disparity causes the order and frequency of updates for states to change in such a way, that some weights might diverge. There are very simple examples, e.g. the “star problem” introduced by Baird [1], which causes fundamental critic learning methods to diverge. In the next section some more details concerning to the off-policy case are discussed [11].

## 机器学习代写|强化学习project代写reinforence learning代考|Temporal Differences and Bellman Residuals

In the following, two basic fundamental critic-learning approaches are discussed, which aim to find the best possible parametric approximation function. They both use Stochastic Gradient Descent (SGD) to minimize an objective, thus the may suffer from optimization error, especially in the case of nonlinear function approximation.

Temporal-difference learning (TD-learning) was introduced by Sutton [10]. The simplest version of TD-learning, called TD $(0)$, tries to minimize the mean squared error. But instead of using MC estimates to approximate to true value function, it uses onestep temporal-differences estimates. The resulting parameter update function is
$$\theta_{t+1}=\theta_{t}+\alpha_{t}\left[R_{t}+\gamma \hat{v}{\theta{\mathrm{r}}}\left(s_{t+1}\right)-\hat{v}{\theta{t}}\left(s_{t}\right)\right] \frac{\delta \hat{v}{\theta{\mathrm{r}}}\left(s_{t}\right)}{\delta \theta}$$
where $\alpha$ is the learning rate of SGD. So a dependency on the quality of the function approximation is introduced. Since $R_{t}+\gamma \hat{v}{\theta{t}}\left(s_{t+1}\right)$ and $v_{\pi}(s)$ differ, Sutton and Barto [11] describe this procedure to be “semi-gradient” as the objective introduces a bias. Since TD $(0)$ converges to the fix-point of the $\overline{\mathrm{PBE}}$ objective, the often used term “TD-fix-point” simply refers to this fix-point [3]. The main problem with TDlearning is, that there are very simple examples, for which TD $(0)$ diverges, e.g. the already mentioned “star problem” introduced by Baird [1]. So TD-learning suffers from $d^{b}(s) \neq \mu(s)$ in the off-policy case and can diverge.

Due to the instability of TD-learning, Baird [1] introduced the Residual-Gradient algorithm (RG) with guaranteed off-policy convergence. RG directly performs SGD on the $\overline{\mathrm{BE}}$ objective. The resulting parameter update function is
$$\theta_{t+1}=\theta_{t}+\alpha_{t}\left[R_{t}+\gamma \hat{v}{\theta{t}}\left(s_{t+1}\right)-\hat{v}{\theta{t}}\left(s_{t}\right)\right]\left(\frac{\delta \hat{v}{\theta{t}}\left(s_{t}\right)}{\delta \theta}-\gamma \frac{\delta \hat{v}{\theta{\mathrm{r}}}\left(s_{t+1}\right)}{\delta \theta}\right)$$
The only difference between the updates of $\mathrm{TD}(0)$ and RG is a correction of the multiplicative term. A drawback of RG is, that it converges very slow and hence requires extensive interaction between actor and environment [1].

## 机器学习代写|强化学习project代写reinforence learning代考|Bellman Equation and Temporal Differences

d吨=r(s吨,一种吨)+C在^θ(s吨+1)−在^θ(s吨).

TDE¯(θ)=和μ[和磷,圆周率[d吨2∣s吨]] =和μ[在^θ(s)−和磷,圆周率[(r(s吨,一种吨)+C在^θ(s吨+1))2∣圆周率,s吨=s]].

## 机器学习代写|强化学习project代写reinforence learning代考|Error Sources of Policy Evaluation Methods

• 客观偏差：目标函数的最小值通常与均方误差的最小值不对应，例如 arg分钟θ在和¯≠ 参数⁡分钟θ
• 抽样错误：因为不可能在整个状态集上收集样本小号，学习近似函数必须仅使用有限数量的样本来完成。
• Optimization error: Optimization errors occur, when the chosen optimization methods does not find the (global) optimum, eg due to non-convexity of the objective function.

## 机器学习代写|强化学习project代写reinforence learning代考|Temporal Differences and Bellman Residuals

Sutton [10] 介绍了时差学习（TD-learning）。TD-learning 最简单的版本，称为 TD(0), 试图最小化均方误差。但它不是使用 MC 估计来逼近真值函数，而是使用单步时间差估计。得到的参数更新函数是
θ吨+1=θ吨+一种吨[R吨+C在^θr(s吨+1)−在^θ吨(s吨)]d在^θr(s吨)dθ

θ吨+1=θ吨+一种吨[R吨+C在^θ吨(s吨+1)−在^θ吨(s吨)](d在^θ吨(s吨)dθ−Cd在^θr(s吨+1)dθ)

## 有限元方法代写

tatistics-lab作为专业的留学生服务机构，多年来已为美国、英国、加拿大、澳洲等留学热门地的学生提供专业的学术服务，包括但不限于Essay代写，Assignment代写，Dissertation代写，Report代写，小组作业代写，Proposal代写，Paper代写，Presentation代写，计算机作业代写，论文修改和润色，网课代做，exam代考等等。写作范围涵盖高中，本科，研究生等海外留学全阶段，辐射金融，经济学，会计学，审计学，管理学等全球99%专业科目。写作团队既有专业英语母语作者，也有海外名校硕博留学生，每位写作老师都拥有过硬的语言能力，专业的学科背景和学术写作经验。我们承诺100%原创，100%专业，100%准时，100%满意。

## MATLAB代写

MATLAB 是一种用于技术计算的高性能语言。它将计算、可视化和编程集成在一个易于使用的环境中，其中问题和解决方案以熟悉的数学符号表示。典型用途包括：数学和计算算法开发建模、仿真和原型制作数据分析、探索和可视化科学和工程图形应用程序开发，包括图形用户界面构建MATLAB 是一个交互式系统，其基本数据元素是一个不需要维度的数组。这使您可以解决许多技术计算问题，尤其是那些具有矩阵和向量公式的问题，而只需用 C 或 Fortran 等标量非交互式语言编写程序所需的时间的一小部分。MATLAB 名称代表矩阵实验室。MATLAB 最初的编写目的是提供对由 LINPACK 和 EISPACK 项目开发的矩阵软件的轻松访问，这两个项目共同代表了矩阵计算软件的最新技术。MATLAB 经过多年的发展，得到了许多用户的投入。在大学环境中，它是数学、工程和科学入门和高级课程的标准教学工具。在工业领域，MATLAB 是高效研究、开发和分析的首选工具。MATLAB 具有一系列称为工具箱的特定于应用程序的解决方案。对于大多数 MATLAB 用户来说非常重要，工具箱允许您学习应用专业技术。工具箱是 MATLAB 函数（M 文件）的综合集合，可扩展 MATLAB 环境以解决特定类别的问题。可用工具箱的领域包括信号处理、控制系统、神经网络、模糊逻辑、小波、仿真等。