econ-ark / HARK

Heterogenous Agents Resources & toolKit
Apache License 2.0
315 stars 195 forks source link

portfolio consumer model with recursive block definition working with generic monte carlo #1417

Open sbenthall opened 3 weeks ago

sbenthall commented 3 weeks ago

This PR:

The model in consumer.py is an attempt to demonstrate how a value, such as R, can be either calibrated directly or set by a dynamic block (in this case, the portfolio block) while reusing the same consumption block data.

It also shows the use of a tick block to set $k_{t+1} = a_t$

sbenthall commented 3 weeks ago

This PR builds on #1414, which should be merged first

sbenthall commented 3 weeks ago

this is really work towards #1374

sbenthall commented 1 week ago

TODO: Allow nested RBlocks

sbenthall commented 1 week ago

TODO: Demo in a test the way that the consumption DBlock can be used with or without the RBlock

sbenthall commented 6 days ago

I believe this PR is ready. Requesting final review from @alanlujan91 or @mnwhite

This PR now supports recursively defined models, and demonstrates how a model can be composed of pre-made blocks.

Specifically, it shows how the portfolio consumption model can be built from the basic consumer model by adding one more block. This block makes the R rate of return an endogenous state that's a function of the risky return and stigma, overriding the default calibration of this value.

sbenthall commented 5 days ago

Added normalized version of consumption block