Skip to content

Commit 8f5d9bf

Browse files
committed
misc
1 parent c916218 commit 8f5d9bf

File tree

1 file changed

+37
-50
lines changed

1 file changed

+37
-50
lines changed

lectures/cake_eating_stochastic.md

Lines changed: 37 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -37,25 +37,42 @@ We can think of this cake as a harvest that regrows if we save some seeds.
3737
Specifically, if we save (invest) part of today's cake, it grows into next
3838
period's cake according to a stochastic production process.
3939

40-
This extension introduces several new elements:
40+
```{note}
41+
The term "cake eating" is not such a good fit now that we have a stochastic and
42+
potentially growing state.
43+
44+
Nonetheless, we'll continue to refer to cake eating to maintain flow from the
45+
previous lectures.
46+
47+
Soon we'll move to more ambitious optimal savings/consumption problems and adopt
48+
new terminology.
49+
50+
This lecture serves as a bridge between cake eating and the more ambitious
51+
problems.
52+
```
53+
54+
The extensions in this lecture introduce several new elements:
4155

4256
* nonlinear returns to saving, through a production function, and
4357
* stochastic returns, due to shocks to production.
4458

4559
Despite these additions, the model remains relatively tractable.
4660

47-
We solve the model using dynamic programming and value function iteration (VFI).
61+
As a first pass, we will solve the model using dynamic programming and value function iteration (VFI).
4862

49-
This lecture is connected to stochastic dynamic optimization theory, although we do not
50-
consider multiple agents at this point.
63+
```{note}
64+
In later lectures we'll explore more efficient methods for this class of problems.
5165
52-
It serves as a bridge between the simple deterministic cake eating
53-
problem and more sophisticated stochastic consumption-saving models studied in
66+
At the same time, VFI is foundational and globally convergent.
5467
55-
* {cite}`StokeyLucas1989`, chapter 2
56-
* {cite}`Ljungqvist2012`, section 3.1
57-
* [EDTC](https://johnstachurski.net/edtc.html), chapter 1
58-
* {cite}`Sundaram1996`, chapter 12
68+
Hence we want to be sure we can use this method too.
69+
```
70+
71+
More information on this savings problem can be found in
72+
73+
* {cite}`Ljungqvist2012`, Section 3.1
74+
* [EDTC](https://johnstachurski.net/edtc.html), Chapter 1
75+
* {cite}`Sundaram1996`, Chapter 12
5976

6077
Let's start with some imports:
6178

@@ -281,9 +298,8 @@ The term $\int v(f(x - c) z) \phi(dz)$ can be understood as the expected next pe
281298
* the state is $x$
282299
* consumption is set to $c$
283300

284-
As shown in [EDTC](https://johnstachurski.net/edtc.html), theorem 10.1.11 and a range of other texts
285-
286-
> *The value function* $v^*$ *satisfies the Bellman equation*
301+
As shown in [EDTC](https://johnstachurski.net/edtc.html), theorem 10.1.11 and a range of other texts,
302+
the value function $v^*$ satisfies the Bellman equation.
287303

288304
In other words, {eq}`fpb30` holds when $v=v^*$.
289305

@@ -420,12 +436,17 @@ In practice economists often work with unbounded utility functions --- and so wi
420436

421437
In the unbounded setting, various optimality theories exist.
422438

423-
Unfortunately, they tend to be case-specific, as opposed to valid for a large range of applications.
424-
425439
Nevertheless, their main conclusions are usually in line with those stated for
426440
the bounded case just above (as long as we drop the word "bounded").
427441

428-
Consult, for example, section 12.2 of [EDTC](https://johnstachurski.net/edtc.html), {cite}`Kamihigashi2012` or {cite}`MV2010`.
442+
```{note}
443+
444+
Consult the following references for more on the unbounded case:
445+
446+
* The lecture {doc}`ifp_advanced`.
447+
* Section 12.2 of [EDTC](https://johnstachurski.net/edtc.html).
448+
```
449+
429450

430451
## Computation
431452

@@ -819,7 +840,6 @@ utility specification.
819840
820841
Setting $\gamma = 1.5$, compute and plot an estimate of the optimal policy.
821842
822-
Time how long this function takes to run.
823843
```
824844

825845
```{solution-start} og_ex1
@@ -859,36 +879,3 @@ plt.show()
859879
```{solution-end}
860880
```
861881

862-
```{exercise}
863-
:label: og_ex2
864-
865-
Time how long it takes to iterate with the Bellman operator
866-
20 times, starting from initial condition $v(x) = u(x)$.
867-
868-
Use the model specification in the previous exercise.
869-
870-
```
871-
872-
```{solution-start} og_ex2
873-
:class: dropdown
874-
```
875-
876-
Let's set up:
877-
878-
```{code-cell} ipython3
879-
model = create_model(u=u_crra, f=fcd)
880-
v = model.u(model.grid)
881-
```
882-
883-
Here's the timing:
884-
885-
```{code-cell} ipython3
886-
%%time
887-
888-
for i in range(20):
889-
v_greedy, v_new = T(v, model)
890-
v = v_new
891-
```
892-
893-
```{solution-end}
894-
```

0 commit comments

Comments
 (0)