Some advice as you get closer to having all the pieces being in place (bear in mind, I haven't tried to run your code).
The main thing is to take it one step at a time:
- Start simple: can you solve for the SS with S periods?
- TPI with S-periods?
- SS with endogenous labor?
- TPI with endogenous labor?
- Now add population dynamics: solve SS
- Solve TPI with population dynamics
It's going to be hard to debug the entire model if you don't know that each of the components work.
- Consider writing tests of individual functions that might give you trouble.
- If you need to debug, simplify through changes in parameter values. For example, think about how you can an
omega that is consistent with everyone living a full life (i.e., rho = 0 except for rho[-1]) and no immigration? In this way you can zero-out population changes and will know what BQ = 0...
- Read into the tracebacks when you get errors to better identify the problem.
- Consider special cases (e.g., if population dynamics are zeroed out and the initial distribution of savings =
b_ss, then you are staring in the SS and so the entire time path should be the SS)
Some advice as you get closer to having all the pieces being in place (bear in mind, I haven't tried to run your code).
The main thing is to take it one step at a time:
It's going to be hard to debug the entire model if you don't know that each of the components work.
omegathat is consistent with everyone living a full life (i.e.,rho= 0 except forrho[-1]) and no immigration? In this way you can zero-out population changes and will know whatBQ= 0...b_ss, then you are staring in the SS and so the entire time path should be the SS)