Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OLG Model #17

Open
andiaz90 opened this issue Jun 5, 2023 · 1 comment
Open

OLG Model #17

andiaz90 opened this issue Jun 5, 2023 · 1 comment

Comments

@andiaz90
Copy link

andiaz90 commented Jun 5, 2023

Can the toolbox be used to build an OLG model? Is it possible to set a state variable like age?

@mrognlie
Copy link
Contributor

mrognlie commented May 4, 2024

If you're okay with stylized age structure, i.e. a few age states like "young", "middle", and "old" with stochastic aging between them, then the toolkit can easily be used to add a life-cycle dimension to the model, since this age structure can be part of the driving exogenous Markov process. The toolkit can either accept multiple independent stochastic processes, i.e. exogenous=['Pi_age', 'Pi_e'], in which case it will expect all your value function and policy arrays to have two leading dimensions corresponding to the two processes; or (a bit less efficient) you can manually use the Kronecker product to create a combined Markov matrix Pi. (See also #22.)

Unfortunately, if you want detailed age structure—say, where we keep track of aging at an annual or quarterly frequency, so that there is a state for 32 year olds, 33 year olds, etc.—then the toolkit is currently not well-suited to this. In principle you could represent the deterministic aging process with a huge Pi_age Markov matrix, but this matrix would be extremely sparse, and I don't think the toolkit can currently handle a sparse Markov matrix. It also doesn't know how to take advantage of the special structure of deterministic aging (i.e. where it's easy to do backward and forward iterations when calculating the steady state, because you start iterations at the end and beginning of life, respectively). This is something we'd certainly like to add at some point!

Finally, one speculative possibility might be to represent age as a continuous variable rather than an exogenous discrete one. It's conceivable that this would work even using the current toolkit, but I haven't thought carefully about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants