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
8 changes: 4 additions & 4 deletions .translate/state/two_auctions.md.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
source-sha: 6e967af4856b8164815524fe56c7df5ce59a6138
synced-at: "2026-07-18"
source-sha: 364f150b17587ab54aabb0445822640cbb4af0f2
synced-at: "2026-07-28"
model: claude-sonnet-5
mode: RESYNC
mode: UPDATE
section-count: 13
tool-version: 0.17.0
tool-version: 0.24.0
20 changes: 10 additions & 10 deletions lectures/two_auctions.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ jupytext:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.10.3
jupytext_version: 1.17.1
kernelspec:
display_name: Python 3 (ipykernel)
language: python
Expand Down Expand Up @@ -216,7 +216,7 @@ plt.rcParams.update({'font.size': 14})
colors = plt.rcParams['axes.prop_cycle'].by_key()['color']

# ensure the notebook generates the same randomness
np.random.seed(1337)
rng = np.random.default_rng(1337)
```

我们重复进行一个有5个投标人的拍卖100,000次。
Expand All @@ -227,7 +227,7 @@ np.random.seed(1337)
N = 5
R = 100_000

v = np.random.uniform(0, 1, (N, R))
v = rng.uniform(0, 1, (N, R))

# BNE in first-price sealed bid

Expand Down Expand Up @@ -441,7 +441,7 @@ v_grid = np.linspace(0.3, 1, 8)
bid_analytical = b_star(v_grid, N)

# 重新抽取估值
v = np.random.uniform(0, 1, (N, R))
v = rng.uniform(0, 1, (N, R))
bid_simulated = [evaluate_largest(ii, v) for ii in v_grid]

fig, ax = plt.subplots(figsize=(6, 4))
Expand All @@ -463,8 +463,8 @@ sns.despine()
我们先通过以下Python代码来了解 $\chi^2$ 分布:

```{code-cell} ipython3
np.random.seed(1337)
v = np.random.chisquare(df=2, size=(N * R,))
rng = np.random.default_rng(1337)
v = rng.chisquare(df=2, size=(N * R,))

plt.hist(v, bins=50, edgecolor='w')
plt.xlabel('Values: $v$')
Expand All @@ -474,8 +474,8 @@ plt.show()
现在我们让Python构建一个出价函数

```{code-cell} ipython3
np.random.seed(1337)
v = np.random.chisquare(df=2, size=(N, R))
rng = np.random.default_rng(1337)
v = rng.chisquare(df=2, size=(N, R))

# 我们计算v的分位数作为我们的网格
pct_quantile = np.linspace(0, 100, 101)[1:-1]
Expand Down Expand Up @@ -673,8 +673,8 @@ class bid_price_solution:
```

```{code-cell} ipython3
np.random.seed(1337)
v = np.random.chisquare(df=2, size=(N, R))
rng = np.random.default_rng(1337)
v = rng.chisquare(df=2, size=(N, R))

chi_squ_case = bid_price_solution(v)
```
Expand Down
Loading