Skip to content

Commit 714cda2

Browse files
committed
minor updates
1 parent 0608eb0 commit 714cda2

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

lectures/mle.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ $$
8484
n = 10_000
8585
```
8686

87-
这些数据来源于[消费者财务状况调查](https://en.wikipedia.org/wiki/Survey_of_Consumer_Finances) (SCF)。<!-- 这里没有找到中午的对应百科链接 -->
87+
这些数据来源于[消费者财务状况调查](https://en.wikipedia.org/wiki/Survey_of_Consumer_Finances) (SCF)。
8888

8989
以下代码导入了数据并将其读入名为 `sample` 的数组。
9090

@@ -95,7 +95,7 @@ url = 'https://media.githubusercontent.com/media/QuantEcon/high_dim_data/update_
9595
df = pd.read_csv(url)
9696
df = df.dropna()
9797
df = df[df['year'] == 2016]
98-
df = df.loc[df['n_wealth'] > 1 ] # 限制数据为净财富大于 1 的数据 <!-- 原网页可能有笔误,应该是wealth而不是worth -->
98+
df = df.loc[df['n_wealth'] > 1 ] # 限制数据为净财富大于 1 的数据
9999
rv = df['n_wealth'].sample(n=n, random_state=1234)
100100
rv = rv.to_numpy() / 100_000
101101
sample = rv
@@ -165,7 +165,7 @@ plt.show()
165165
166166
这些估计值可以通过最大化给定数据的似然函数获得。
167167
168-
对数正态分布随机变量 $X$ 的概率密度函数 (pdf) 如下:
168+
对数正态分布随机变量 $X$ 的概率密度函数 (PDF) 如下:
169169
170170
$$
171171
f(x, \mu, \sigma)
@@ -242,7 +242,7 @@ fig, ax = plt.subplots() # 创建图形和轴
242242
ax.set_xlim(-1,20) # 设置x轴的范围
243243
244244
ax.hist(sample, density=True, bins=5_000, histtype='stepfilled', alpha=0.5) # 绘制样本的直方图
245-
ax.plot(x, dist_lognorm.pdf(x), 'k-', lw=0.5, label='对数正态分布pdf') # 绘制对数正态分布的PDF
245+
ax.plot(x, dist_lognorm.pdf(x), 'k-', lw=0.5, label='对数正态分布PDF') # 绘制对数正态分布的PDF
246246
ax.legend() # 显示图例
247247
plt.show() # 展示图形
248248
```
@@ -320,7 +320,7 @@ ax.set_xlim(-1, 20)
320320
ax.set_ylim(0,1.75)
321321
322322
ax.hist(sample, density=True, bins=5_000, histtype='stepfilled', alpha=0.5)
323-
ax.plot(x, dist_pareto.pdf(x), 'k-', lw=0.5, label='帕累托分布pdf')
323+
ax.plot(x, dist_pareto.pdf(x), 'k-', lw=0.5, label='帕累托分布PDF')
324324
ax.legend()
325325
326326
plt.show()
@@ -379,7 +379,7 @@ dist_lognorm_tail = lognorm(σ_hat_tail, scale = exp(μ_hat_tail))
379379
fig, ax = plt.subplots()
380380
ax.set_xlim(0,50)
381381
ax.hist(sample_tail, density=True, bins=500, histtype='stepfilled', alpha=0.5)
382-
ax.plot(x, dist_lognorm_tail.pdf(x), 'k-', lw=0.5, label='对数正态分布pdf')
382+
ax.plot(x, dist_lognorm_tail.pdf(x), 'k-', lw=0.5, label='对数正态分布PDF')
383383
ax.legend()
384384
plt.show()
385385
```
@@ -403,7 +403,7 @@ fig, ax = plt.subplots()
403403
ax.set_xlim(0, 50)
404404
ax.set_ylim(0,0.65)
405405
ax.hist(sample_tail, density=True, bins= 500, histtype='stepfilled', alpha=0.5)
406-
ax.plot(x, dist_pareto_tail.pdf(x), 'k-', lw=0.5, label='帕累托分布pdf')
406+
ax.plot(x, dist_pareto_tail.pdf(x), 'k-', lw=0.5, label='帕累托分布PDF')
407407
plt.show()
408408
```
409409
@@ -417,9 +417,9 @@ plt.show()
417417
418418
一种检验方法是,将数据与拟合分布进行绘图,如我们刚才所做的。
419419
420-
还有其他更严谨的测试方法,比如[科尔莫哥洛夫-斯米尔诺夫检验](https://baike.baidu.com/item/科尔莫格罗夫一斯米尔诺夫拟合优度检验/22366278)。
420+
还有其他更严谨的测试方法,比如[科尔莫格罗夫一斯米尔诺夫拟合优度检验](https://baike.baidu.com/item/科尔莫格罗夫一斯米尔诺夫拟合优度检验/22366278)。
421421
422-
我们省略了这些更深入的主题(但鼓励读者在完成这些讲座后研究它们)。
422+
我们省略了这些更深入的主题(但我们鼓励读者在完成这些讲座后研究它们)。
423423
424424
## 练习
425425
@@ -476,7 +476,7 @@ fig, ax = plt.subplots()
476476
ax.set_xlim(-1, 20)
477477
478478
ax.hist(sample, density=True, bins=5000, histtype='stepfilled', alpha=0.5)
479-
ax.plot(x, dist_exp.pdf(x), 'k-', lw=0.5, label='指数分布pdf')
479+
ax.plot(x, dist_exp.pdf(x), 'k-', lw=0.5, label='指数分布PDF')
480480
ax.legend()
481481
482482
plt.show()

0 commit comments

Comments
 (0)