Skip to content

Commit 33fdd78

Browse files
committed
update lecture
1 parent f4ca4eb commit 33fdd78

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

lectures/tax_smooth.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -325,9 +325,13 @@ print('Cost:', cost(tax_model, T_seq))
325325
```
326326
327327
### Experiments
328+
328329
In this section we describe how a tax sequence would optimally respond to different sequences of government expenditures.
330+
329331
First we create a function `plot_ts` that generates graphs for different instances of the tax-smoothing model `tax_model`.
332+
330333
This will help us avoid rewriting code to plot outcomes for different government expenditure sequences.
334+
331335
```{code-cell} ipython3
332336
def plot_ts(model, # tax-smoothing model
333337
B0, # initial government debt
@@ -351,6 +355,7 @@ def plot_ts(model, # tax-smoothing model
351355
plt.ylabel(r'$T_t,G_t,B_t$')
352356
plt.show()
353357
```
358+
354359
In the experiments below, please study how tax and government debt sequences vary across different sequences for government expenditures.
355360
356361
#### Experiment 1: one-time spending shock
@@ -361,14 +366,16 @@ We'll make $W_0$ big - positive to indicate a spending surge (like a war or disa
361366
362367
```{code-cell} ipython3
363368
# Spending surge W_0 = 2.5
364-
G_seq_pos = np.concatenate([np.ones(21), np.array([2.5]), np.ones(24), np.zeros(20)])
369+
G_seq_pos = np.concatenate([np.ones(21), np.array([2.5]),
370+
np.ones(24), np.zeros(20)])
365371
366372
plot_ts(tax_model, B0, G_seq_pos)
367373
```
368374
369375
```{code-cell} ipython3
370376
# Spending cut W_0 = -2.5
371-
G_seq_neg = np.concatenate([np.ones(21), np.array([-2.5]), np.ones(24), np.zeros(20)])
377+
G_seq_neg = np.concatenate([np.ones(21), np.array([-2.5]),
378+
np.ones(24), np.zeros(20)])
372379
373380
plot_ts(tax_model, B0, G_seq_neg)
374381
```
@@ -454,6 +461,7 @@ plot_ts(tax_model, B0, G_seq_geo)
454461
We promised to justify our claim that a constant tax rate $T_t = T_0$ for all $t$ is optimal.
455462
456463
Let's do that now.
464+
457465
The approach we'll take is an elementary example of the "calculus of variations".
458466
459467
Let's dive in and see what the key idea is.
@@ -462,7 +470,7 @@ To explore what types of tax paths are welfare-improving, we shall create an **a
462470
that satisfies
463471
464472
$$
465-
\sum_{t=0}^S R^{-t} v_t = 0
473+
\sum_{t=0}^S R^{-t} v_t = 0.
466474
$$
467475
468476
This equation says that the **present value** of admissible tax path variations must be zero.
@@ -474,7 +482,7 @@ So once again, we encounter a formula for the present value:
474482
Here we'll restrict ourselves to a two-parameter class of admissible tax path variations of the form
475483
476484
$$
477-
v_t = \xi_1 \phi^t - \xi_0
485+
v_t = \xi_1 \phi^t - \xi_0.
478486
$$
479487
480488
We say two and not three-parameter class because $\xi_0$ will be a function of $(\phi, \xi_1; R)$ that guarantees that the variation sequence is feasible.
@@ -566,6 +574,7 @@ plt.xlabel(r'$t$')
566574
plt.ylabel(r'$T_t$')
567575
plt.show()
568576
```
577+
569578
We can even use the Python `np.gradient` command to compute derivatives of cost with respect to our two parameters.
570579
571580
We are teaching the key idea beneath the **calculus of variations**.
@@ -583,9 +592,11 @@ def cost_rel(ξ1, ϕ):
583592
G_seq=G_seq,
584593
verbose=0)
585594
return cost(tax_model, Tvar_seq)
595+
586596
# Vectorize the function to allow array input
587597
cost_vec = np.vectorize(cost_rel)
588598
```
599+
589600
Then we can visualize the relationship between cost and $\xi_1$ and compute its derivatives
590601
591602
```{code-cell} ipython3
@@ -749,5 +760,6 @@ Multiplying both sides by inverse of the matrix on the left again provides the s
749760
:label: taxsmooth_ex2
750761
751762
As an exercise, we ask you to represent and solve a **third-order linear difference equation**.
763+
752764
How many initial conditions must you specify?
753765
```

0 commit comments

Comments
 (0)