Skip to content
Open
Show file tree
Hide file tree
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
10 changes: 5 additions & 5 deletions .translate/state/os_egm.md.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
source-sha: 1abb15f5fc0273ea02b47850f447b3c224255123
synced-at: "2026-07-22"
model: claude-opus-4-8
mode: NEW
source-sha: 6234f272c9d4fba80da267cb08c5c43bbbf40d67
synced-at: "2026-07-31"
model: claude-sonnet-5
mode: UPDATE
section-count: 3
tool-version: 0.20.0
tool-version: 0.24.0
8 changes: 3 additions & 5 deletions lectures/os_egm.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ u'(c)

然后迭代继续……


### 内生网格

上面讨论的方法需要一个求根程序来找到对应于给定收入值 $x_i$ 的 $c_i$。
Expand Down Expand Up @@ -148,7 +147,6 @@ c_i =

EGM 这个名称源于网格 $\{x_i\}$ 是**内生**确定的这一事实。


## 实现

与 {doc}`os_time_iter` 中一样,我们将从一个简单的设定开始,其中
Expand Down Expand Up @@ -218,8 +216,8 @@ def create_model(
s_grid = np.linspace(1e-4, grid_max, grid_size)

# 存储冲击(带种子,使结果可复现)
np.random.seed(seed)
shocks = np.exp(μ + ν * np.random.randn(shock_size))
rng = np.random.default_rng(seed)
shocks = np.exp(μ + ν * rng.standard_normal(shock_size))

return Model(
u, f, β, μ, ν, s_grid, shocks, α, u_prime, f_prime, u_prime_inv
Expand Down Expand Up @@ -362,4 +360,4 @@ EGM 比时间迭代更快,因为它避免了数值求根。

在 {doc}`os_egm_jax` 中,我们将使用一个完全向量化且高效的 EGM 版本,它还使用 JAX 进行了并行化。

这为求解我们过去几讲一直在研究的最优消费问题提供了一种极其快速的方法。
这为求解我们过去几讲一直在研究的最优消费问题提供了一种极其快速的方法。
Loading