Skip to content
Merged
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/perm_income.md.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
source-sha: a73ba0f7db0a6783ab5b9cca269a9f95f88106cb
synced-at: "2025-06-17"
model: unknown
mode: RESYNC
source-sha: ab687aad2134b4eee2835f896be4b956e73001bb
synced-at: "2026-07-23"
model: claude-sonnet-5
mode: UPDATE
section-count: 6
tool-version: 0.20.0
tool-version: 0.22.0
10 changes: 5 additions & 5 deletions lectures/perm_income.md
Original file line number Diff line number Diff line change
Expand Up @@ -501,8 +501,8 @@ r = 0.05
T = 60

@jit
def time_path(T):
w = np.random.randn(T+1) # w_0, w_1, ..., w_T
def time_path(T, rng):
w = rng.standard_normal(T+1) # w_0, w_1, ..., w_T
w[0] = 0
b = np.zeros(T+1)
for t in range(1, T+1):
Expand All @@ -511,7 +511,8 @@ def time_path(T):
c = μ + (1 - β) * (σ * w - b)
return w, b, c

w, b, c = time_path(T)
rng = np.random.default_rng()
w, b, c = time_path(T, rng)

fig, ax = plt.subplots(figsize=(10, 6))

Expand All @@ -534,7 +535,7 @@ fig, ax = plt.subplots(figsize=(10, 6))

b_sum = np.zeros(T+1)
for i in range(250):
w, b, c = time_path(T) # Generate new time path
w, b, c = time_path(T, rng) # Generate new time path
rcolor = random.choice(('c', 'g', 'b', 'k'))
ax.plot(c, color=rcolor, lw=0.8, alpha=0.7)

Expand Down Expand Up @@ -1025,4 +1026,3 @@ $$
[^f5]: 如果由$y^t$张成的线性空间等于由$w^t$张成的线性空间,则过程$y_t$的移动平均表示被称为**基本的**。通过卡尔曼滤波获得的时不变创新表示在构造上是基本的。

[^f8]: 相关思想的有趣应用请参见{cite}`CampbellShiller88`、{cite}`LettLud2001`、{cite}`LettLud2004`。

Loading