From 8076432cee80664f1cfa5f604681aa9711e5f08e Mon Sep 17 00:00:00 2001 From: Chihiro Watanabe Date: Sat, 25 Jul 2026 22:56:07 +0900 Subject: [PATCH] Update rng usage in os_stochastic.md Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_01Rs2tDEcDXLnfMnM88v8e1D --- lectures/os_stochastic.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lectures/os_stochastic.md b/lectures/os_stochastic.md index 204568e68..5ba75f01a 100644 --- a/lectures/os_stochastic.md +++ b/lectures/os_stochastic.md @@ -505,8 +505,8 @@ def create_model( x_grid = np.linspace(1e-4, grid_max, grid_size) # Store shocks (with a seed, so results are reproducible) - np.random.seed(seed) - shocks = np.exp(μ + ν * np.random.randn(shock_size)) + rng = np.random.default_rng(seed) + shocks = np.exp(μ + ν * rng.standard_normal(shock_size)) return Model(u, f, β, μ, ν, x_grid, shocks) ```