Skip to content

[kalman_2] update translation #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions lectures/kalman_2.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ kernelspec:

这两个变量都是公司无法直接观察到的。

公司只能通过观察工人产生的产出历史,以及理解这些产出如何依赖于工人的人力资本,以及人力资本如何作为工人努力程度的函数来演化,来了解这些信息
公司只能通过观察工人历史产出,以及理解这些产出如何依赖于工人的人力资本,以及人力资本如何作为工人努力程度的函数来演化,来了解上述变量

我们将设定一个规则,说明公司如何根据每期获得的信息来支付工人工资。

Expand All @@ -49,7 +49,7 @@ kernelspec:
!pip install quantecon
```

为了进行模拟,我们引入以下导入,与 {doc}`卡尔曼滤波器的初步介绍 <kalman>` 相同:
为了进行模拟,我们引入以下函数库,与 {doc}`卡尔曼滤波器的初步介绍 <kalman>` 相同:

```{code-cell} ipython3
import matplotlib.pyplot as plt
Expand Down Expand Up @@ -115,7 +115,7 @@ y_t & = g h_t + v_t , \quad v_t \sim {\mathcal N} (0, R)

这意味着从公司的角度来看,工人的努力程度实际上是一个未知的固定"参数"。

在时间 $t\geq 1$,对于特定工人,公司观察到 $y^{t-1} = [y_{t-1}, y_{t-2}, \ldots, y_0]$。
在时间 $t\geq 1$,对于特定工人,公司观察到 $y^{t-1} = [y_{t-1}, y_{t-2}, \ldots, y_0]$(用上式左侧符号表示右侧集合)

公司无法观察到工人的"类型" $(h_0, u_0)$。

Expand Down Expand Up @@ -257,9 +257,9 @@ u_hat_t = x_hat_t[1, :]

对于 $h_0, u_0$ 的一个实现,我们绘制 $E y_t = G \hat x_t $,其中 $\hat x_t = E [x_t | y^{t-1}]$。

我们还绘制 $E [u_0 | y^{t-1}]$,这是公司基于其拥有的信息 $y^{t-1}$ 对工人固有的"工作伦理" $u_0$ 的推断。
我们还绘制 $E [u_0 | y^{t-1}]$,这是公司基于其拥有的信息 $y^{t-1}$ 对工人固有的"工作努力程度" $u_0$ 的推断。

我们可以观察公司对工人工作伦理的推断 $E [u_0 | y^{t-1}]$ 如何逐渐收敛于隐藏的 $u_0$,而 $u_0$ 是公司无法直接观察到的。
我们可以观察公司对工人工作努力程度的推断 $E [u_0 | y^{t-1}]$ 如何逐渐收敛于隐藏的 $u_0$,而 $u_0$ 是公司无法直接观察到的。

```{code-cell} ipython3
fig, ax = plt.subplots(1, 2)
Expand All @@ -284,7 +284,7 @@ plt.show()

## 一些计算实验

让我们看看 $\Sigma_0$ 和 $\Sigma_T$,以了解公司在设定的时间范围内对隐藏状态了解多少
让我们看看 $\Sigma_0$ 和 $\Sigma_T$,以表示公司在设定的时间范围内对隐藏状态了解多少

```{code-cell} ipython3
print(Σ_t[:, :, 0])
Expand All @@ -296,7 +296,7 @@ print(Σ_t[:, :, -1])

显然,条件协方差矩阵中的元素随时间变小。

通过在不同时间 $t$ 绘制 $E [x_t |y^{t-1}] $ 周围的置信椭圆,我们可以生动地展示条件协方差矩阵 $\Sigma_t$ 如何演化。
通过在不同时间 $t$ 绘制 $E [x_t |y^{t-1}] $ 周围的置信椭圆,我们可以形象地展示条件协方差矩阵 $\Sigma_t$ 如何演化。

```{code-cell} ipython3
# 创建用于等高线绘制的点网格
Expand Down Expand Up @@ -336,13 +336,13 @@ plt.tight_layout()
plt.show()
```

注意证据 $y^t$ 的积累如何随着样本量 $t$ 的增长影响置信椭圆的形状。
注意 $y^t$ 的积累是如何随着样本量 $t$ 的增长影响置信椭圆的形状。

现在让我们使用我们的代码将隐藏状态 $x_0$ 设置为特定的向量,以观察公司如何从我们感兴趣的某个 $x_0$ 开始学习。

例如,让我们说 $h_0 = 0$ 和 $u_0 = 4$。
例如,让我们设 $h_0 = 0$ 和 $u_0 = 4$。

这是实现这个目标的一种方式
这是实现这个例子的一种方式

```{code-cell} ipython3
# 例如,我们可能想要 h_0 = 0 和 u_0 = 4
Expand All @@ -364,7 +364,7 @@ print('h_0 =', h_0)
print('u_0 =', u_0)
```

实现相同目标的另一种方式是使用以下代码
实现相同例子的另一种方式是使用以下代码

```{code-cell} ipython3
# 如果我们想要设置初始
Expand Down Expand Up @@ -442,9 +442,9 @@ print(hard_working_worker)

我们还可以为不同的工人模拟 $T = 50$ 期的系统。

推断的工作伦理和真实工作伦理之间的差异随时间收敛到 $0$。
推断的工作努力程度和真实工作努力程度之间的差异随时间收敛到 $0$。

这表明滤波器正在逐渐教会工人和公司关于工人努力程度的信息
这表明滤波器正在逐渐向工人和公司传递关于工人努力程度的信息

```{code-cell} ipython3
:tags: [hide-input]
Expand Down Expand Up @@ -482,7 +482,7 @@ def simulate_workers(worker, T, ax, mu_0=None, Sigma_0=None,
u_hat_t[i] = x_hat[1]

if diff == True:
title = (cjk('推断的工作伦理与真实工作伦理的差异随时间变化')
title = (cjk('推断的工作努力程度与真实工作努力程度的差异随时间变化')
if title == None else title)

ax.plot(u_hat_t - u_0, alpha=.5)
Expand All @@ -494,7 +494,7 @@ def simulate_workers(worker, T, ax, mu_0=None, Sigma_0=None,
else:
label_line = (r'$E[u_t|y^{t-1}]$' if name == None
else name)
title = (cjk('推断的工作伦理随时间变化')
title = (cjk('推断的工作努力程度随时间变化')
if title == None else title)

u_hat_plot = ax.plot(u_hat_t, label=label_line)
Expand Down Expand Up @@ -598,4 +598,4 @@ plt.show()

## 未来扩展

我们可以通过创建新类型的工人,并让公司仅通过观察他们的产出历史来了解他们的隐藏(对公司来说)状态,来进行许多富有启发性的实验。
我们可以通过创建新类型的工人,并让公司仅通过观察他们的产出历史来了解他们的隐藏状态(对公司来说),来进行许多富有启发性的实验。
Loading