From 8811bc390cba71db69ede1ed021eab66b2fbb4bf Mon Sep 17 00:00:00 2001 From: Chihiro Watanabe Date: Mon, 18 May 2026 15:31:58 +0900 Subject: [PATCH] Update rng usage in solow.md Co-Authored-By: Claude Sonnet 4.6 --- lectures/solow.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lectures/solow.md b/lectures/solow.md index 0fd3007c..ad6655ee 100644 --- a/lectures/solow.md +++ b/lectures/solow.md @@ -589,13 +589,14 @@ s = 0.6 α = 0.3 δ = 0.5 x0 = [.25, 3.25] # list of initial values used for simulation +rng = np.random.default_rng() ``` Let's define the function *k_next* to find the next value of $k$ ```{code-cell} ipython3 def lgnorm(): - return np.exp(μ + σ * np.random.randn()) + return np.exp(μ + σ * rng.standard_normal()) def k_next(s, α, δ, k): return lgnorm() * s * k**α + (1 - δ) * k