econ-ark / HARK

Heterogenous Agents Resources & toolKit
Apache License 2.0
335 stars 198 forks source link

New model: Portfolio allocation #114

Closed mnwhite closed 5 years ago

mnwhite commented 7 years ago

As a small start on incorporating models with multiple assets, we should implement the basic portfolio allocation model with one risky and one riskless asset, as in the latter part of Chris' SolvingMicroDSOPs notes. All of the necessary math is there (except calculation of zero-income-risk risky asset share --> limit as mNrm --> infinity), so this won't be hard. The only annoying bit is that we do need to use a non-linear solver to get risky share at each aNrm gridpoint. Off-the-shelf 1D solvers will be slow as we'll lose fully vectorized form, might need to hand write one if we want reasonable speed.

mnwhite commented 7 years ago

Posting this now because one of my students is tackling this for her course project.

mnwhite commented 7 years ago

Student ultimately did not complete this assignment. This is now available for other people to work on. I can provide a set of notes / guidance for how to tackle this in HARK.

tbeason commented 6 years ago

I have a Julia implementation of Cocco, Gomes, Maenhout (2005) in both VFI (derived from their posted Fortran code) and EGM flavors. Porting the EGM code over to python + HARK should be an easy task for anybody familiar with the framework (I'm not a python user myself).

mnwhite commented 6 years ago

Very cool. Have you made your Julia code available online? If you link it here, that will make it easy for someone else to come in port it to Python. Looking over the CGM paper, the model appears (effectively) identical to the one in CDC's lecture notes (mentioned at the top of this thread), which is what I wrote up HARK solution notes for. This is good.

tbeason commented 6 years ago

It lives in a private repo right now, I'll clean it up a little and then paste it in a Gist and link it here later today.

tbeason commented 6 years ago

https://gist.github.com/tbeason/105a04a9c476e367894e9d4ca893a826

I first copied the authors' Fortran VFI code over to Julia, and then I changed that code to use EGM. So, the layout is kind of funky and suboptimal. But it works! Please let me know if you find errors.

mnwhite commented 6 years ago

To put the relevant links in the same issue thread:

These are the lecture notes by CDC that I referred to in the original post. The model we want to do first is in section 7.

These are the programming notes I wrote for this model; they have some links to other potentially useful CDC lecture notes at the end

ccutsail commented 6 years ago

I'm going to work on this.

npalmer-professional commented 6 years ago

Excellent!

shaunagm commented 5 years ago

Any updates, @ccutsail?

pkofod commented 5 years ago

Any updates, @ccutsail?

This is the one I have a PR for @shaunagm . The labels refer to me, not ccutsail.

shaunagm commented 5 years ago

Great @pkofod. Got confused by ccutsail's comment saying they were going to work on it.

Is #241 the PR?

pkofod commented 5 years ago

Yes, yes it is

sbenthall commented 5 years ago

The PR is merged. Should this issue be closed?