Skip to content

Commit 093e12d

Browse files
committed
misc
1 parent 8faa975 commit 093e12d

File tree

1 file changed

+38
-6
lines changed

1 file changed

+38
-6
lines changed

lectures/newton_method.md

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,35 @@ kernelspec:
2828

2929
## Overview
3030

31-
The lecture will apply Newton's method in one-dimensional and multi-dimensional settings to solve fixed-point and root-finding problems.
31+
Many economic problems involve solving for [fixed
32+
points](https://en.wikipedia.org/wiki/Fixed_point_(mathematics)) and
33+
[roots](https://en.wikipedia.org/wiki/Zero_of_a_function) (sometimes called
34+
"zeros") of functions.
35+
36+
For example, in a simple supply and demand model, an equilibrium price is one
37+
that makes excess demand zero.
38+
39+
In other words, an equilibrium is a root of the excess demand function.
40+
41+
There are various computational techniques for solving for fixed points and
42+
roots.
43+
44+
In this lecture we study a very important one called [Newton's
45+
method](https://en.wikipedia.org/wiki/Newton%27s_method).
46+
47+
Newton's method does not always work but, in situations where it does,
48+
convergence is often very fast when compared to other methods.
49+
50+
The lecture will apply Newton's method in one-dimensional and
51+
multi-dimensional settings to solve fixed-point and root-finding problems.
3252

3353
We first consider an easy, one-dimensional fixed point problem where we know the solution and solve it using both successive approximation and Newton's method.
3454

3555
Then we generalize Newton's method to multi-dimensional settings to solve market equilibrium with multiple goods.
3656

57+
At the end of the lecture we leverage the power of JAX and automatic
58+
differentiation to solve a very high-dimensional equilibrium problem.
59+
3760
In each step, we will refine and improve our implementation and compare our results to alternative methods.
3861

3962
We use the following imports in this lecture
@@ -51,14 +74,15 @@ plt.rcParams["figure.figsize"] = (10, 5.7)
5174

5275
## Fixed Point Computation Using Newton's Method
5376

54-
In this section, we will solve the fixed point of the law of motion for capital under the Solow model.
77+
In this section, we will solve the fixed point of the law of motion for capital in the setting of the [Solow growth model](https://en.wikipedia.org/wiki/Solow%E2%80%93Swan_model).
5578

5679
We will inspect the fixed point visually, solve it by successive approximation, and then apply Newton's method to achieve faster convergence.
5780

5881
(solow)=
5982
### The Solow Model
6083

61-
Assuming Cobb-Douglas production technology, the law of motion for capital is
84+
In the Solow growth model, assuming Cobb-Douglas production technology and
85+
zero population growth, the law of motion for capital is
6286

6387
```{math}
6488
:label: motion_law
@@ -73,8 +97,13 @@ where
7397

7498
In this example, we will try to calculate the fixed point for the law of motion for capital.
7599

100+
In other words, we seek a $k^*$ such that $g(k^*)=k^*$, where $g(k) :=
101+
sAk^\alpha + (1-\delta)k$.
102+
103+
* $k^*$ is called a [steady state](https://en.wikipedia.org/wiki/Steady_state)
104+
because $k_t = k^*$ implies $k_{t+1} = k^*$.
76105

77-
Since we will use these parameters in many functions for this example, let's store our parameters in [`namedtuple`](https://docs.python.org/3/library/collections.html#collections.namedtuple) to help us keep our code clean and concise.
106+
Let's store our parameters in [`namedtuple`](https://docs.python.org/3/library/collections.html#collections.namedtuple) to help us keep our code clean and concise.
78107

79108
```{code-cell} python3
80109
SolowParameters = namedtuple("SolowParameters", ('A', 's', 'α', 'δ'))
@@ -88,7 +117,7 @@ def create_solow_params(A=2.0, s=0.3, α=0.3, δ=0.4):
88117
return SolowParameters(A=A, s=s, α=α, δ=δ)
89118
```
90119

91-
The next two functions implements the law of motion [](motion_law) and the true fixed point $k^*$.
120+
The next two functions implement the law of motion [](motion_law) and the true fixed point $k^*$.
92121

93122
```{code-cell} python3
94123
def g(k, params):
@@ -152,6 +181,9 @@ plt.show()
152181

153182
First, let's compute the fixed point using successive approximation.
154183

184+
This elementary method simply involves repeatedly updating capital using the
185+
law of motion until it converges.
186+
155187
Here's a time series from a particular choice of $k_0$.
156188

157189

@@ -987,4 +1019,4 @@ e(p, A, b, c)
9871019
We can see the result is very accurate.
9881020

9891021
```{solution-end}
990-
```
1022+
```

0 commit comments

Comments
 (0)