# YOUR PROJECT TITLE

> **Note the following:** 
> 1. This is *not* meant to be an example of an actual **model analysis project**, just an example of how to structure such a project.
> 1. Remember the general advice on structuring and commenting your code from [lecture 5](https://numeconcopenhagen.netlify.com/lectures/Workflow_and_debugging).
> 1. Remember this [guide](https://www.markdownguide.org/basic-syntax/) on markdown and (a bit of) latex.
> 1. Turn on automatic numbering by clicking on the small icon on top of the table of contents in the left sidebar.
> 1. The `modelproject.py` file includes a function which could be used multiple times in this notebook.

Imports and set magics:


```python
import numpy as np
from scipy import optimize
import sympy as sm

# autoreload modules when code is run
%load_ext autoreload
%autoreload 2

# local modules
import modelproject
```

# OverLapping Generation (OLG)Model

Consider an economy where individuals live for two periods, and the population grows at a constant rate $n>0$. Identical competitive firms maximize their profits employing a Cobb-Douglas technology that combines labor, $L_{t}$, and capital, $K_{t}$, so that $Y_{t}=A K_{t}^{\alpha} L_{t}^{1-\alpha}$, with $\alpha \in(0,1)$. Assume full capital depreciation (i.e., $\delta=1$ ). Under these assumptions, profit maximization leads to:
$$
\begin{aligned}
r_{t} &=\alpha A k_{t}^{\alpha-1}, \\
w_{t} &=(1-\alpha) A k_{t}^{\alpha},
\end{aligned}
$$
where $r_{t}$ is the (net) rental rate of capital, $w_{t}$ is the wage rate, and $k_{t}$ denotes capital in per-worker units.
Utility for young individuals born in period $t$ is
$$
U_{t}=\ln c_{1 t}+\frac{1}{1+\rho} \ln c_{2 t+1},
$$
with $\rho>-1 . c_{1 t}$ denotes consumption when young, $c_{2 t+1}$ consumption when old. Young agents spend their entire time endowment, which is normalized to one, working. Suppose the government runs an unfunded (pay-as-you-go) social security system, according to which the young pay a contribution $d_{t}$ that

amounts to a fraction $\tau \in(0,1)$ of their wages. Thus, the contributions are paid out in the same period to the current old. The latter do not work, and sustain their consumption through their savings and the social security benefits. Thus, the budget constraints in each period of life read as:
$$
\begin{aligned}
c_{1 t}+s_{t} &=(1-\tau) w_{t} \\
c_{2 t+1} &=s_{t} R_{t+1}+(1+n) d_{t+1}
\end{aligned}
$$
where $R_{t+1}=r_{t+1}$ under $\delta=1$.
a Set up and solve the individual's problem of optimal intertemporal allocation of resources. Derive the Euler equation. Show that individual saving behavior is characterized by
$$
s_{t}=\frac{1}{2+\rho}(1-\tau) w_{t}-\tau \frac{1+\rho}{2+\rho} \frac{1+n}{1+r_{t+1}} w_{t+1}
$$
b Show that the capital accumulation equation that gives $k_{t+1}$, as a function of $k_{t}$, is given by
$$
k_{t+1}=\frac{1}{1+\frac{1+\rho}{2+\rho} \frac{(1-\alpha)}{\alpha} \tau}\left[\frac{(1-\alpha)(1-\tau)}{(1+n)(2+\rho)} A k_{t}^{\alpha}\right]
$$

Show also that, in the steady state, the amount of capital-per-worker is
$$
\bar{k}=\left[\frac{1}{1+\frac{1+\rho}{2+\rho} \frac{(1-\alpha)}{\alpha} \tau} \frac{(1-\alpha)(1-\tau) A}{(1+n)(2+\rho)}\right]^{\frac{1}{1-\alpha}} .
$$
c Suppose that, at time $T$, before saving decisions are made, the government decides to switch to a fully funded social security system according to which the young pay a contribution $d_{T}$ that amounts to a fraction $\tau \in$ $(0,1)$ of their wages. These contributions are then paid out in the next period, together with the accrued interest rate. The budget constraints in each period of life now read as:
$$
\begin{aligned}
c_{1 t}+s_{t} &=(1-\tau) w_{t}, \\

c_{2 t+1} &=\left(s_{t}+\tau w_{t}\right) R_{t+1}, \quad \text { for } t \geq T
\end{aligned}
$$
Show that the new steady-state capital-per-worker, which is denoted by $\bar{k}^{\prime}$, is such that
$$
\bar{k}^{\prime}=\left[\frac{(1-\alpha) A}{(1+n)(2+\rho)}\right]^{\frac{1}{1-\alpha}} .
$$

d In the absence of any compensation from the government, the old generation at time $T$ is worse off, after the social security system is changed. Explain why. How could the government intervene to compensate them, without imposing any burden on the current generation of workers?

# OLG model different pension schemes

## Model description

### Unfunded social security system

**Time:** Discrete and indexed by $t\in\{0,1,\dots\}$.

**Demographics:** Population grows at a constant rate $n>0$ and a life consists of
two periods; *young* and *old*.

**Households:** Utility for young individuals born in period $t$ is
$$
\begin{aligned}
 & U_{t}=\ln c_{1 t}+\frac{1}{1+\rho} \ln c_{2 t+1} \\
 & \text{s.t.}\\
 & S_{t}=s_{t}(1-\tau_{w})w_{t}\\
 & C_{1t}=(1-s_{t})(1-\tau_{w})w_{t}\\
 & C_{2 t+1}=s_{t} r_{t+1}+(1+n) d_{t+1} 
\end{aligned}
$$
with $\rho>-1 . c_{1 t}$ denotes consumption when young, $c_{2 t+1}$ consumption when old, where the agents do not work.  Young agents spend their entire time endowment, which is normalized to one, working. Suppose the government runs an unfunded (pay-as-you-go) social security system, according to which the young pay a contribution $d_{t}$ that amounts to a fraction $\tau \in(0,1)$ of their wages.

**Firms:** Firms rent capital $K_{t-1}$ at the rental rate $r_{t}^{K}$,
and hires labor $E_{t}$ at the wage rate $w_{t}$. Firms have access
to the production function
    
$$
\begin{aligned}
Y_{t}=F(K_{t-1},E_{t})=A K_{t-1}^{\alpha} E_{t}^{1-\alpha},\,\,\,,\alpha\in(0,1)
\end{aligned}
$$
    
Profits are
    
$$
\begin{aligned}
\Pi_{t}=Y_{t}-w_{t}E_{t}-r_{t}^{K}K_{t-1}
\end{aligned}
$$

**Government:** The Government is not directly included in the model, but runs the social security system by paying the contribution $d_t=\tau w_t$ of the young generation's wage to the old generation.

**Capital:** Depreciates with a rate of $\delta \in [0,1]$.

### Fully funded social security system

The young pay a contribution $d_{T}$ that amounts to a fraction $\tau \in$ $(0,1)$ of their wages. hese contributions are then paid out in the next period, together with the accrued interest rate. The budget constraints are now:

$$
\begin{aligned}
c_{1 t}+s_{t} &=(1-\tau) w_{t}, \\
c_{2 t+1} &=\left(s_{t}+\tau w_{t}\right) r_{t+1}, \quad \text { for } t \geq T
\end{aligned}
$$


```python

```

## Analytical solution

If your model allows for an analytical solution, you should provide here.

You may use Sympy for this. Then you can characterize the solution as a function of a parameter of the model.

To characterize the solution, first derive a steady state equation as a function of a parameter using Sympy.solve and then turn it into a python function by Sympy.lambdify. See the lecture notes for details. 

## Numerical solution

You can always solve a model numerically. 

Define first the set of parameters you need. 

Then choose one of the optimization algorithms that we have gone through in the lectures based on what you think is most fitting for your model.

Are there any problems with convergence? Does the model converge for all starting values? Make a lot of testing to figure these things out. 

# Further analysis

Make detailed vizualizations of how your model changes with parameter values. 

Try to make an extension of the model. 

# Conclusion

Add concise conclusion. 

a188795e3b84074a08eed34ed0dd4f69b86ab9ad
ipynb
Jupyter Notebook
modelproject/modelproject.ipynb
NumEconCopenhagen/projects-2022-teamp-up
543a661b285a91178a676031379ef211f9794c81
MIT
modelproject/modelproject.ipynb
NumEconCopenhagen/projects-2022-teamp-up
543a661b285a91178a676031379ef211f9794c81
MIT
2022-03-29T08:08:13.000Z
2022-03-30T09:17:52.000Z
modelproject/modelproject.ipynb
NumEconCopenhagen/projects-2022-teamp-up
543a661b285a91178a676031379ef211f9794c81
MIT
Qwen/Qwen-72B
1. YES
2. YES