You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To solve the equilibrium of the CRRA case numerically using [](equilibrium_crra).
739
+
Solve the equilibrium of the CRRA case numerically using [](equilibrium_crra).
740
740
741
741
Plot the equilibrium quantity and equilibrium price in the equilibrium plot with the CRRA utility (TODO label and refer the plot generated by the code).
742
+
```
742
743
743
744
744
-
745
-
### Solution to exercise 1
746
-
747
-
To solve the equation we need to turn to Newton's method.
To solve the equation we need to turn to Newton's method. `find_Rstar` is used to find $R^*_{t+1}$ by finding the zero of equation [](equilibrium_crra) using the helper function `find_Rstar_newton` for a given value of $K_t$. Similary, `find_Kstar` finds the equilibrium quantity $K^*_{t+1}$ using the value of $R^*_{t+1}$.
750
+
755
751
```{code-cell} ipython3
756
752
def find_Rstar_newton(x, K_prev, model):
757
753
α, β, γ, L = model.α, model.β, model.u.__defaults__[0], model.L
758
754
lhs = L * (1-α) * (K_prev / L)**α
759
755
lhs /= (1 + β**(-1/γ) * x**((γ-1)/γ))
760
-
# To should always non-negative for a real solution.
Let's keep the model the same except for replacing the utility function $u(c)$ in {eq}`eq_crra` with a quasilinear form $u(c)=c + c^{\theta}$.
806
801
807
-
Like what we did in the crra case we don't have an analytical solution.
802
+
Like what we did in the CRRA case we don't have an analytical solution.
808
803
809
804
Try to compute the time path capital $\{k_t\}$ in this case.
805
+
```
810
806
811
-
+++
812
-
813
-
### Solution to exercise 2
807
+
```{solution-start} olg_ex2
808
+
:class: dropdown
809
+
```
814
810
815
811
To get the time path capital $\{k_t\}$ first we need to solve the household's utility maximization problem for the optimal consumption and optimal saving.
816
812
@@ -825,74 +821,62 @@ Let $k_t := K_t / L$.
825
821
826
822
Since [](aggregate_supply_capital_log_olg), [](wage_2) and [](interest_rate_2) the Euler equation becomes
0 commit comments