Skip to content

Commit 77d3b9a

Browse files
Update rng usage in os_stochastic.md (#997)
Claude-Session: https://claude.ai/code/session_01Rs2tDEcDXLnfMnM88v8e1D Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
1 parent b2551d1 commit 77d3b9a

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)