@@ -1318,3 +1318,324 @@ experiment_model(shocks, S, model, run_min, plot_results, 'g')
13181318
13191319``` {solution-end}
13201320```
1321+
1322+ (growth_model)=
1323+ ## 外生增长
1324+
1325+ 在前面的部分中,我们考虑的是没有外生增长的模型。
1326+
1327+ 我们通过设置$A_t = 1$对所有$t$,将生产函数中的$A_t$项设为常数。
1328+
1329+ 现在我们准备考虑增长。
1330+
1331+ 为了纳入增长,我们将生产函数修改为
1332+
1333+ $$
1334+ Y_t = F(K_t, A_tn_t)
1335+ $$
1336+
1337+ 其中$Y_t$是总产出,$N_t$是总就业,$A_t$是劳动增进型技术变化,$F(K, AN)$是与之前相同的线性齐次生产函数。
1338+
1339+ 我们假设$A_t$遵循以下过程
1340+
1341+ $$
1342+ A_{t+1} = \mu_{t+1}A_t
1343+ $$ (eq:growth)
1344+
1345+ 并且$\mu_{t+1}=\bar{\mu}>1$。
1346+
1347+ ```{code-cell} ipython3
1348+ # 将常数A参数设置为None
1349+ model = create_model(A=None)
1350+ ```
1351+
1352+ ```{code-cell} ipython3
1353+ def compute_A_path(A0, shocks, S=100):
1354+ """
1355+ 计算A随时间的路径。
1356+ """
1357+ A_path = np.full(S + 1, A0)
1358+ for t in range(1, S + 1):
1359+ A_path[t] = A_path[t-1] * shocks['μ'][t-1]
1360+ return A_path
1361+ ```
1362+
1363+ ### 非弹性劳动供给
1364+
1365+ 根据线性齐次性,生产函数可以表示为
1366+
1367+ $$
1368+ y_t=f(k_t)
1369+ $$
1370+
1371+ 其中$f(k)=F(k,1) = k^\alpha$和$k_t=\frac{K_t}{n_tA_t}$,$y_t=\frac{Y_t}{n_tA_t}$。
1372+
1373+ $k_t$和$y_t$是按"有效劳动"$A_tn_t$单位测量的。
1374+
1375+ 我们还设$c_t=\frac{C_t}{A_tn_t}$和$g_t=\frac{G_t}{A_tn_t}$,其中$C_t$和$G_t$分别是总消费和总政府支出。
1376+
1377+ 我们继续考虑非弹性劳动供给的情况。
1378+
1379+ 基于此,可行性可由方程{eq}`eq:feasi_capital`的以下修改版本来总结:
1380+
1381+ $$
1382+ k_ {t+1}=\mu_ {t+1}^{-1}[ f(k_t)+(1-\delta)k_t-g_t-c_t]
1383+ $$ (eq:feasi_mod)
1384+
1385+
1386+ 同样,根据线性齐次生产函数的性质,我们有
1387+
1388+ $$
1389+ \eta_t = F_k(k_t, 1) = f'(k_t), w_t = F_n(k_t, 1) = f(k_t) - f'(k_t)k_t
1390+ $$
1391+
1392+ 由于现在人均消费是$c_tA_t$,欧拉方程{eq}`eq:diff_second`的对应形式是
1393+
1394+ $$
1395+ \begin{aligned}
1396+ u'(c_tA_t) = \beta u'(c_ {t+1}A_ {t+1}) \frac{(1 + \tau_ {ct})}{(1 + \tau_ {ct+1})} [ (1 - \tau_ {kt+1})(f'(k_ {t+1}) - \delta) + 1] .
1397+ \end{aligned}
1398+ $$ (eq:diff_mod)
1399+
1400+ $\bar{R}_{t+1}$继续由{eq}`eq:gross_rate`定义,除了现在$k_t$是每有效劳动单位的资本。
1401+
1402+ 因此,将{eq}`eq:gross_rate`代入,{eq}`eq:diff_mod`变为
1403+
1404+ $$
1405+ u'(c_tA_t) = \beta u'(c_ {t+1}A_ {t+1})\bar{R}_ {t+1}
1406+ $$
1407+
1408+ 假设家庭的效用函数与之前相同,我们有
1409+
1410+ $$
1411+ (c_tA_t)^{-\gamma} = \beta (c_ {t+1}A_ {t+1})^{-\gamma} \bar{R}_ {t+1}
1412+ $$
1413+
1414+ 因此,{eq}`eq:consume_R`的对应形式是
1415+
1416+ $$
1417+ c_ {t+1} = c_t \left[ \beta \bar{R}_ {t+1} \right] ^{\frac{1}{\gamma}}\mu_ {t+1}^{-1}
1418+ $$ (eq:consume_r_mod)
1419+
1420+ ### 稳态
1421+
1422+ 在稳态中,$c_{t+1} = c_t$。那么{eq}`eq:diff_mod`变为
1423+
1424+ $$
1425+ 1=\mu^{-\gamma}\beta[ (1-\tau_k)(f'(k)-\delta)+1]
1426+ $$ (eq:diff_mod_st)
1427+
1428+ 从中我们可以计算出每有效劳动单位的稳态资本水平满足
1429+
1430+ $$
1431+ f'(k)=\delta + (\frac{\frac{1}{\beta}\mu^{\gamma}-1}{1-\tau_k})
1432+ $$ (eq:cap_mod_st)
1433+
1434+ 并且
1435+
1436+ $$
1437+ \bar{R}=\frac{\mu^{\gamma}}{\beta}
1438+ $$ (eq:Rbar_mod_st)
1439+
1440+ 每有效劳动单位的稳态消费水平可以使用{eq}`eq:feasi_mod`求得:
1441+
1442+ $$
1443+ c = f(k)+(1-\delta-\mu)k-g
1444+ $$
1445+
1446+ 由于算法和绘图例程与之前相同,我们在{ref}`cass_fiscal_shooting`部分包含稳态计算和射击例程。
1447+
1448+ ### 射击算法
1449+
1450+ 现在我们可以应用射击算法来计算均衡。我们通过包含$\mu_t$来扩充冲击变量向量,然后按之前的方法进行。
1451+
1452+ ### 实验
1453+
1454+ 让我们运行一些实验:
1455+
1456+ 1. 在第10期$\mu$从1.02到1.025的可预见的一次性永久增长
1457+ 2. 在第0期$\mu$到1.025的不可预见的一次性永久增长
1458+
1459+ +++
1460+
1461+ #### 实验1:在t=10时$\mu$从1.02到1.025的可预见增长
1462+
1463+ 下图显示了在t=10时生产率增长$\mu$从1.02永久增长到1.025的影响。
1464+
1465+ 它们现在以有效劳动单位测量$c$和$k$。
1466+
1467+ ```{code-cell} ipython3
1468+ shocks = {
1469+ 'g': np.repeat(0.2, S + 1),
1470+ 'τ_c': np.repeat(0.0, S + 1),
1471+ 'τ_k': np.repeat(0.0, S + 1),
1472+ 'μ': np.concatenate((np.repeat(1.02, 10), np.repeat(1.025, S - 9)))
1473+ }
1474+
1475+ A_path = compute_A_path(1.0, shocks, S)
1476+
1477+ k_ss_initial, c_ss_initial = steady_states(model,
1478+ shocks['g'][0],
1479+ shocks['τ_k'][0],
1480+ shocks['μ'][0]
1481+ )
1482+
1483+ print(f"稳态资本: {k_ss_initial:.4f}")
1484+ print(f"稳态消费: {c_ss_initial:.4f}")
1485+
1486+ # 使用A_path参数运行射击算法
1487+ solution = run_shooting(shocks, S, model, A_path)
1488+
1489+ fig, axes = plt.subplots(2, 3, figsize=(10, 8))
1490+ axes = axes.flatten()
1491+
1492+ plot_results(solution, k_ss_initial,
1493+ c_ss_initial, shocks, 'μ', axes, model,
1494+ A_path, T=40)
1495+
1496+ for ax in axes[5:]:
1497+ fig.delaxes(ax)
1498+
1499+ plt.tight_layout()
1500+ plt.show()
1501+ ```
1502+
1503+ 图中的结果主要由{eq}`eq:diff_mod_st`驱动,表明$\mu$的永久增长将导致每有效劳动单位的稳态资本值减少。
1504+
1505+ 图表明以下几点:
1506+
1507+ - 随着资本变得更有效率,即使资本较少,人均消费也可以提高。
1508+ - 消费平滑驱动了对$\mu$增长的预期*消费立即跳跃*。
1509+ - 资本生产率的增加导致总收益率$\bar R$增加。
1510+ - 完全预见使得资本增长率增加的影响先于其发生,在$t=0$时就可见其影响。
1511+
1512+ #### 实验2:在t=0时$\mu$从1.02到1.025的不可预见增长
1513+
1514+ 下图显示了在t=0时$\mu$立即跳跃到1.025的影响。
1515+
1516+ ```{code-cell} ipython3
1517+ shocks = {
1518+ 'g': np.repeat(0.2, S + 1),
1519+ 'τ_c': np.repeat(0.0, S + 1),
1520+ 'τ_k': np.repeat(0.0, S + 1),
1521+ 'μ': np.concatenate((np.repeat(1.02, 1), np.repeat(1.025, S)))
1522+ }
1523+
1524+ A_path = compute_A_path(1.0, shocks, S)
1525+
1526+ k_ss_initial, c_ss_initial = steady_states(model,
1527+ shocks['g'][0],
1528+ shocks['τ_k'][0],
1529+ shocks['μ'][0]
1530+ )
1531+
1532+ print(f"稳态资本: {k_ss_initial:.4f}")
1533+ print(f"稳态消费: {c_ss_initial:.4f}")
1534+
1535+ # 使用A_path参数运行射击算法
1536+ solution = run_shooting(shocks, S, model, A_path)
1537+
1538+ fig, axes = plt.subplots(2, 3, figsize=(10, 8))
1539+ axes = axes.flatten()
1540+
1541+ plot_results(solution, k_ss_initial,
1542+ c_ss_initial, shocks, 'μ', axes, model, A_path, T=40)
1543+
1544+ for ax in axes[5:]:
1545+ fig.delaxes(ax)
1546+
1547+ plt.tight_layout()
1548+ plt.show()
1549+ ```
1550+
1551+ 同样,我们可以将上面使用的程序收集到一个函数中,该函数运行求解器并为给定实验绘制图表。
1552+
1553+ ```{code-cell} ipython3
1554+ def experiment_model(shocks, S, model, A_path, solver, plot_func, policy_shock, T=40):
1555+ """
1556+ 给定模型运行射击算法并绘制结果。
1557+ """
1558+ k0, c0 = steady_states(model, shocks['g'][0], shocks['τ_k'][0], shocks['μ'][0])
1559+
1560+ print(f"稳态资本: {k0:.4f}")
1561+ print(f"稳态消费: {c0:.4f}")
1562+ print('-'*64)
1563+
1564+ fig, axes = plt.subplots(2, 3, figsize=(10, 8))
1565+ axes = axes.flatten()
1566+
1567+ solution = solver(shocks, S, model, A_path)
1568+ plot_func(solution, k0, c0,
1569+ shocks, policy_shock, axes, model, A_path, T=T)
1570+
1571+ for ax in axes[5:]:
1572+ fig.delaxes(ax)
1573+
1574+ plt.tight_layout()
1575+ plt.show()
1576+ ```
1577+
1578+ ```{code-cell} ipython3
1579+ shocks = {
1580+ 'g': np.repeat(0.2, S + 1),
1581+ 'τ_c': np.repeat(0.0, S + 1),
1582+ 'τ_k': np.repeat(0.0, S + 1),
1583+ 'μ': np.concatenate((np.repeat(1.02, 1), np.repeat(1.025, S)))
1584+ }
1585+
1586+ experiment_model(shocks, S, model, A_path, run_shooting, plot_results, 'μ')
1587+ ```
1588+
1589+ 图表显示:
1590+
1591+ - 由于没有前馈效应,所有变量的路径现在都是平滑的。
1592+ - 每有效劳动单位的资本逐渐下降到较低的稳态水平。
1593+ - 每有效劳动单位的消费立即跳跃,然后平滑下降到较低的稳态值。
1594+ - 税后总收益率$\bar{R}$再次与消费增长率同向变动,验证了欧拉方程{eq}`eq:diff_mod_st`。
1595+
1596+ ```{exercise}
1597+ :label: cass_fiscal_ex3
1598+
1599+ 使用残差最小化的第二种方法重现我们两个实验的图:
1600+ 1. 在t=10时$\mu$从1.02到1.025的可预见增长
1601+ 2. 在t=0时$\mu$从1.02到1.025的不可预见增长
1602+ ```
1603+
1604+ ```{solution-start} cass_fiscal_ex3
1605+ :class: dropdown
1606+ ```
1607+
1608+ 这是一个解决方案:
1609+
1610+ **实验1:在$t=10$时$\mu$从1.02到1.025的可预见增长**
1611+
1612+ ```{code-cell} ipython3
1613+ shocks = {
1614+ 'g': np.repeat(0.2, S + 1),
1615+ 'τ_c': np.repeat(0.0, S + 1),
1616+ 'τ_k': np.repeat(0.0, S + 1),
1617+ 'μ': np.concatenate((np.repeat(1.02, 10), np.repeat(1.025, S - 9)))
1618+ }
1619+
1620+ A_path = compute_A_path(1.0, shocks, S)
1621+
1622+ experiment_model(shocks, S, model, A_path, run_min, plot_results, 'μ')
1623+ ```
1624+
1625+ **实验2:在$t=0$时$\mu$从1.02到1.025的不可预见增长**
1626+
1627+ ```{code-cell} ipython3
1628+ shocks = {
1629+ 'g': np.repeat(0.2, S + 1),
1630+ 'τ_c': np.repeat(0.0, S + 1),
1631+ 'τ_k': np.repeat(0.0, S + 1),
1632+ 'μ': np.concatenate((np.repeat(1.02, 1), np.repeat(1.025, S)))
1633+ }
1634+
1635+ experiment_model(shocks, S, model, A_path, run_min, plot_results, 'μ')
1636+ ```
1637+
1638+ ```{solution-end}
1639+ ```
1640+
1641+ 在续篇{doc}`cass_fiscal_2`中,我们研究与{cite:t}`mendoza1998international`密切相关的我们单国模型的两国版本。
0 commit comments