# Permanent Income Model 3: Shooting¶

Generalize the model to non-homothetic preferences.

Now \(g(c)\) depends on \(c\). There is no closed-form solution.

## Algorithm: Shooting¶

Search over values for \(c_{T}\). For each:

- Compute \(c_t\) from the Euler equation (backwards).
- Compute the present value of consumption.
- Check the lifetime budget constraint.

Note: Searching over values of \(c_{1}\) creates numerical problems in some models.

- Roughly: small changes in \(c_{1}\) can imply large changes in \(c_{T}\).
- Example: transition path of a standard growth model (between steady states).
- Higher \(c_{1}\) implies lower saving, higher interest rate, higher consumption growth
- This creates a feedback loop where consumption growth explodes.

## Interpolation¶

A simple way of finding the optimal \(c_T\):

- Compute the present value of consumption on a grid of \(c_T\).
- Interpolate between grid points to find the value that satisfies the budget constraint.

### Algorithm outline:¶

- Initialize the model (unchanged).
- Set up a grid for \(c_{T}\).
- For each grid point: Solve for the present value of consumption.
- Interpolate to find the \(c_{T}\) for which the present value of \(c\) equals \(Y\).

Compute the present value of consumption:

- Input \(c_{T}\) and model.
- Compute the consumption path \(c_{t}\).
- Compute the present value.

Computing the consumption path:

- Start with \(c_{T}\).
- Compute consumption growth.
- Compute \(c_{t-1} = c_{t} / g(c)\).
- Iterate backwards.

Exercise: write this code - and don't forget the tests

### Root Finding¶

In my solution, the interpolation is simply hand coded. Usually, one would use a package for this (such as Interpolations.jl).

Interpolation is, of course, inefficient. We need to compute a large number of grid points for \(c_T\).

A better solution is to use a numerical optimizer.

Solving this model is an example of root finding. We are looking for the solution to \(f(c_T)=0\).

There are various libraries that offer algorithms for root finding and for the more common problem of minimizing a function.

Using these libraries requires that we install packages. In this case, we will use Roots.jl.

See root finding.

`find_zero`

finds the root of a function `f(x)`

. This is what we will use.

Excercise: write this code. My solution with test