Skip to content

Commit 376222b

Browse files
committed
🔄 resync perm_income_cons.md
1 parent 753de32 commit 376222b

2 files changed

Lines changed: 37 additions & 21 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
source-sha: 089e35ca27a9cdff6d341269f77d857f1c46dfd3
2+
synced-at: "2026-07-18"
3+
model: claude-sonnet-5
4+
mode: RESYNC
5+
section-count: 5
6+
tool-version: 0.17.0

lectures/perm_income_cons.md

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,24 @@ kernelspec:
77
display_name: Python 3
88
language: python
99
name: python3
10+
translation:
11+
title: 永久收入 II:线性二次方法
12+
headings:
13+
Overview: 概述
14+
Setup: 设置
15+
Setup::Digression on a Useful Isomorphism: 关于一个有用同构的补充说明
16+
Setup::A Specification of the Nonfinancial Income Process: 非金融收入过程的具体说明
17+
The LQ Approach: LQ方法
18+
The LQ Approach::The LQ Problem: LQ问题
19+
The LQ Approach::Mapping into the LQ Framework: 映射到LQ框架
20+
Implementation: 实现
21+
Implementation::The Exogenous Nonfinancial Income Process: 外生非金融收入过程
22+
Implementation::Comparison with the Difference Equation Approach: 与差分方程方法的比较
23+
Two Example Economies: 两个经济示例
24+
Two Example Economies::First Set of Initial Conditions: 第一组初始条件
25+
Two Example Economies::Population and Sample Panels: 总体和样本面板
26+
Two Example Economies::Population and Sample Panels::Cointegration Residual: 协整残差
27+
Two Example Economies::A "Borrowers and Lenders" Closed Economy: '"借贷者"封闭经济'
1028
---
1129

1230
(perm_income_cons)=
@@ -29,10 +47,9 @@ kernelspec:
2947

3048
除了Anaconda中已有的库外,本讲座还需要以下库:
3149

32-
```{code-cell} ipython
33-
---
34-
tags: [hide-output]
35-
---
50+
```{code-cell} ipython3
51+
:tags: [hide-output]
52+
3653
!pip install quantecon
3754
```
3855

@@ -59,7 +76,7 @@ tags: [hide-output]
5976

6077
* 展示如何使用LQ控制方法获得LQ永久收入模型的解。
6178
* 将模型表示为线性状态空间系统,如{doc}`本讲<linear_models>`所示。
62-
* 应用[QuantEcon](http://quantecon.org/quantecon-py)[LinearStateSpace](https://github.com/QuantEcon/QuantEcon.py/blob/master/quantecon/lss.py)类来描述消费者最优消费和借贷计划的统计特征。
79+
* 应用[QuantEcon](https://quantecon.org/quantecon-py/)[LinearStateSpace](https://github.com/QuantEcon/QuantEcon.py/blob/master/quantecon/lss.py)类来描述消费者最优消费和借贷计划的统计特征。
6380

6481
然后,我们将使用这些特征来构建一个简单的横截面财富和消费动态模型,这是按照Truman Bewley {cite}`Bewley86`的思路进行的。
6582

@@ -73,7 +90,7 @@ tags: [hide-output]
7390

7491
让我们从导入开始:
7592

76-
```{code-cell} ipython
93+
```{code-cell} ipython3
7794
import matplotlib.pyplot as plt
7895
import matplotlib as mpl
7996
FONTPATH = "fonts/SourceHanSerifSC-SemiBold.otf"
@@ -152,9 +169,8 @@ $\{y_t\}$ 的动态仍然遵循线性状态空间模型
152169

153170
如果我们设:
154171

155-
* Barro模型中的总税收$T_t$对应LQ永久收入模型中的消费$c_t$
156-
* Barro模型中的外生政府支出$G_t$对应永久收入模型中的非金融收入$y_t$
157-
172+
* $T_t$,Barro模型中的总税收对应LQ永久收入模型中的消费$c_t$。
173+
* $G_t$,Barro模型中的外生政府支出对应永久收入模型中的非金融收入$y_t$。
158174
* $B_t$,Barro模型中到期的政府无风险一期资产对应于LQ永久收入模型中到期的无风险一期消费者债务$b_t$。
159175
* $R$,Barro模型中无风险一期政府债务的总回报率对应于永久收入消费模型中金融资产的总回报率$1+r$。
160176

@@ -169,7 +185,6 @@ LQ永久收入模型中对$\{c_t, y_t, b_t\}$的所有特征描述自动适用
169185
在本讲中,我们假设$\{y_t\}$是一个二阶单变量自回归过程:
170186

171187
$$
172-
173188
y_{t+1} = \alpha + \rho_1 y_t + \rho_2 y_{t-1} + \sigma w_{t+1}
174189
$$
175190

@@ -206,7 +221,7 @@ $$
206221

207222
这里我们使用基于动态规划的{doc}`LQ方法 <lqcontrol>`来解决相同的模型。
208223

209-
在确认两种方法得出的答案一致后,我们使用[QuantEcon](http://quantecon.org/quantecon-py)[LinearStateSpace](https://github.com/QuantEcon/QuantEcon.py/blob/master/quantecon/lss.py)类来展示模型的特点。
224+
在确认两种方法得出的答案一致后,我们使用[QuantEcon](https://quantecon.org/quantecon-py/)[LinearStateSpace](https://github.com/QuantEcon/QuantEcon.py/blob/master/quantecon/lss.py)类来展示模型的特点。
210225

211226
为什么要用两种不同的方法来求解模型?
212227

@@ -222,7 +237,6 @@ $$
222237
### LQ问题
223238

224239
回顾我们在{doc}`LQ理论讲座<lqcontrol>`中提到,最优线性调节器问题是要选择
225-
226240
用于最小化
227241

228242
$$
@@ -483,7 +497,6 @@ print(c_pol, "\n", -F)
483497
* 消费者在事前是异质的。
484498

485499
在第一个示例中,消费者的非金融收入路径显示
486-
487500
样本早期的明显瞬态
488501

489502
- 这些会以显著方式影响结果
@@ -543,8 +556,8 @@ def income_consumption_debt_series(A, C, G, μ_0, Σ_0, T=150, npaths=25):
543556
debt_var = np.empty(T)
544557
for t in range(T):
545558
μ_x, μ_y, Σ_x, Σ_y = next(moment_generator)
546-
cons_mean[t], cons_var[t] = μ_y[1], Σ_y[1, 1]
547-
debt_mean[t], debt_var[t] = μ_x[3], Σ_x[3, 3]
559+
cons_mean[t], cons_var[t] = μ_y[1,0], Σ_y[1, 1]
560+
debt_mean[t], debt_var[t] = μ_x[3,0], Σ_x[3, 3]
548561
549562
return bsim, csim, ysim, cons_mean, cons_var, debt_mean, debt_var
550563
@@ -594,6 +607,7 @@ def consumption_debt_fanchart(csim, cons_mean, cons_var,
594607
d_perc_95p, d_perc_95m = debt_mean + d95, debt_mean - d95
595608
d_perc_90p, d_perc_90m = debt_mean + d90, debt_mean - d90
596609
610+
597611
# 创建第二个图
598612
fig, ax = plt.subplots(2, 1, figsize=(10, 8))
599613
xvals = np.arange(T)
@@ -675,7 +689,6 @@ $$
675689
下图绘制了{eq}`old12`左侧的实现值,这在{ref}`我们上一讲中讨论过 <coint_pi>`,被称为**协整残差**
676690

677691
如上所述,右侧可以被理解为未来收入预期现值的年金支付
678-
679692
$E_t \sum_{j=0}^\infty \beta^j y_{t+j}$。
680693

681694
在实现过程的早期,当家庭的收入现值和借款几乎同时上升时,$c_t$ 大致保持恒定,而$(1-\beta) b_t$和$(1-\beta) E_t \sum_{j=0}^\infty \beta^j y_{t+j}$都显著上升。
@@ -721,9 +734,7 @@ plt.show()
721734
我们可以使用几乎相同的代码,通过以下方式构建一个"简化版的Bewley模型" {cite}`Bewley86`
722735

723736
- 和之前一样,我们让每个人从 $b_0 = 0$ 开始。
724-
- 但是我们不是让每个人从 $y_{-1} = y_{-2} = 0$ 开始,而是从以下分布中抽取 $\begin{bmatrix} y_{-1} \\ y_{-2} \end{bmatrix}$
725-
726-
$\{y_t\}$ 过程的不变分布。
737+
- 但是我们不是让每个人从 $y_{-1} = y_{-2} = 0$ 开始,而是从 $\{y_t\}$ 过程的不变分布中抽取 $\begin{bmatrix} y_{-1} \\ y_{-2} \end{bmatrix}$。
727738

728739
这构建了一个封闭经济,其中人们以总无风险利率 $R = \beta^{-1}$ 相互借贷。
729740

@@ -769,5 +780,4 @@ plt.show()
769780
```{code-cell} ipython3
770781
cointegration_figure(bsimb, csimb)
771782
plt.show()
772-
```
773-
783+
```

0 commit comments

Comments
 (0)