Skip to content

Commit 6234f27

Browse files
Update rng usage in os_egm.md (#996)
Claude-Session: https://claude.ai/code/session_01Rs2tDEcDXLnfMnM88v8e1D Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 77d3b9a commit 6234f27

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lectures/os_egm.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,8 @@ def create_model(
210210
s_grid = np.linspace(1e-4, grid_max, grid_size)
211211
212212
# Store shocks (with a seed, so results are reproducible)
213-
np.random.seed(seed)
214-
shocks = np.exp(μ + ν * np.random.randn(shock_size))
213+
rng = np.random.default_rng(seed)
214+
shocks = np.exp(μ + ν * rng.standard_normal(shock_size))
215215
216216
return Model(
217217
u, f, β, μ, ν, s_grid, shocks, α, u_prime, f_prime, u_prime_inv

0 commit comments

Comments
 (0)