Skip to content

Commit 8076432

Browse files
Update rng usage in os_stochastic.md
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Rs2tDEcDXLnfMnM88v8e1D
1 parent 370a58f commit 8076432

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lectures/os_stochastic.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -505,8 +505,8 @@ def create_model(
505505
x_grid = np.linspace(1e-4, grid_max, grid_size)
506506
507507
# Store shocks (with a seed, so results are reproducible)
508-
np.random.seed(seed)
509-
shocks = np.exp(μ + ν * np.random.randn(shock_size))
508+
rng = np.random.default_rng(seed)
509+
shocks = np.exp(μ + ν * rng.standard_normal(shock_size))
510510
511511
return Model(u, f, β, μ, ν, x_grid, shocks)
512512
```

0 commit comments

Comments
 (0)