@@ -576,9 +576,7 @@ Let's inspect visually as a first pass
576576num_points = 50
577577firm = create_firm()
578578household = create_household()
579- k_min, k_max = 4, 12
580- k_vals = [k_min + i * (k_max - k_min) / (num_points - 1)
581- for i in range(num_points)]
579+ k_vals = jnp.linspace(4, 12, num_points)
582580out = [G(k, firm, household) for k in k_vals]
583581
584582fig, ax = plt.subplots(figsize=(11, 8))
@@ -655,9 +653,7 @@ def prices_to_capital_stock(household, r, firm):
655653
656654# Create a grid of r values to compute demand and supply of capital
657655num_points = 20
658- r_min, r_max = 0.005, 0.04
659- r_vals = [r_min + i * (r_max - r_min) / (num_points - 1)
660- for i in range(num_points)]
656+ r_vals = jnp.linspace(0.005, 0.04, num_points)
661657
662658# Compute supply of capital
663659k_vals = []
@@ -733,9 +729,7 @@ Use the following values of $\beta$ and plot the relationship you find.
733729``` {code-cell} ipython3
734730:tags: [hide-output]
735731
736- β_min, β_max, num_β = 0.94, 0.98, 20
737- β_vals = [β_min + i * (β_max - β_min) / (num_β - 1)
738- for i in range(num_β)]
732+ β_vals = jnp.linspace(0.94, 0.98, 20)
739733```
740734
741735``` {exercise-end}
0 commit comments