Skip to content

Commit 8811bc3

Browse files
Update rng usage in solow.md
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 5ee005d commit 8811bc3

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lectures/solow.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,13 +589,14 @@ s = 0.6
589589
α = 0.3
590590
δ = 0.5
591591
x0 = [.25, 3.25] # list of initial values used for simulation
592+
rng = np.random.default_rng()
592593
```
593594

594595
Let's define the function *k_next* to find the next value of $k$
595596

596597
```{code-cell} ipython3
597598
def lgnorm():
598-
return np.exp(μ + σ * np.random.randn())
599+
return np.exp(μ + σ * rng.standard_normal())
599600
600601
def k_next(s, α, δ, k):
601602
return lgnorm() * s * k**α + (1 - δ) * k

0 commit comments

Comments
 (0)