Skip to content

Commit e3115df

Browse files
committed
minor updates
1 parent bed1873 commit e3115df

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

lectures/newton_method.md

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@ kernelspec:
2828
:depth: 2
2929
```
3030

31-
```{seealso}
32-
A version of this lecture using [JAX](https://github.com/jax-ml/jax) is {doc}`available here <jax:newtons_method>`
33-
```
34-
3531
## Overview
3632

3733
Many economic problems involve finding [fixed
@@ -69,10 +65,10 @@ problem where we know the solution and solve it using both successive
6965
approximation and Newton's method.
7066

7167
Then we apply Newton's method to multidimensional settings to solve
72-
market for equilibria with multiple goods.
68+
for market equilibria with multiple goods.
7369

7470
At the end of the lecture, we leverage the power of automatic
75-
differentiation in [`jax`](https://docs.jax.dev/en/latest/_autosummary/jax.grad.html) to solve a very high-dimensional equilibrium problem
71+
differentiation in [`jax`](https://docs.jax.dev/en/latest/_autosummary/jax.grad.html) to solve a very high-dimensional equilibrium problem.
7672

7773

7874
We use the following imports in this lecture
@@ -112,7 +108,7 @@ zero population growth, the law of motion for capital is
112108
Here
113109

114110
- $k_t$ is capital stock per worker,
115-
- $A, \alpha>0$ are production parameters, $\alpha < 1$
111+
- $A, \alpha>0$ are production parameters with $\alpha < 1$
116112
- $s>0$ is a savings rate, and
117113
- $\delta \in(0,1)$ is a rate of depreciation
118114

@@ -121,7 +117,7 @@ of $g$, the law of motion for capital.
121117

122118
In other words, we seek a $k^* > 0$ such that $g(k^*) = k^*$.
123119

124-
* such a $k^*$ is called a [steady state](https://en.wikipedia.org/wiki/Steady_state),
120+
* Such a $k^*$ is called a [steady state](https://en.wikipedia.org/wiki/Steady_state),
125121
since $k_t = k^*$ implies $k_{t+1} = k^*$.
126122

127123
Using pencil and paper to solve $g(k) = k$, you will be able to confirm that
@@ -228,7 +224,7 @@ Here's a time series from a particular choice of $k_0$.
228224

229225
```{code-cell} ipython3
230226
def compute_iterates(k_0, f, params, n=25):
231-
"""Compute time series of length n generated by arbitrary function f."""
227+
"""Compute time series of length n generated by function f."""
232228
k = k_0
233229
k_iterates = []
234230
for t in range(n):
@@ -489,13 +485,13 @@ Let's start by computing the market equilibrium of a two-good problem.
489485
We consider a market for two related products, good 0 and good 1, with
490486
price vector $p = (p_0, p_1)$
491487

492-
Supply of good $i$ at price $p$,
488+
Supply of good $i$ at price $p$ is
493489

494490
$$
495491
q^s_i (p) = b_i \sqrt{p_i}
496492
$$
497493

498-
Demand of good $i$ at price $p$ is,
494+
Demand of good $i$ at price $p$ is
499495

500496
$$
501497
q^d_i (p) = \exp(-(a_{i0} p_0 + a_{i1} p_1)) + c_i
@@ -505,7 +501,7 @@ Here $c_i$, $b_i$ and $a_{ij}$ are parameters.
505501

506502
For example, the two goods might be computer components that are typically used together, in which case they are complements. Hence demand depends on the price of both components.
507503

508-
The excess demand function is,
504+
The excess demand function is
509505

510506
$$
511507
e_i(p) = q^d_i(p) - q^s_i(p), \quad i = 0, 1
@@ -818,7 +814,7 @@ The excess demand function is essentially the same, but now the matrix $A$ is $3
818814
dim = 3000
819815
820816
# Create JAX random key
821-
key = jax.random.PRNGKey(123)
817+
key = jax.random.PRNGKey(0)
822818
823819
# Create a random matrix A and normalize the columns to sum to one
824820
A = jax.random.uniform(key, (dim, dim))

0 commit comments

Comments
 (0)