econ-ark / HARK

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

test case and updates for non-independent returns ConsPortfolioModel case #638

Closed sbenthall closed 4 months ago

sbenthall commented 4 years ago

ConsPortfolioModel can be ran with a non-independent return distribution.

The code for this case has not yet been refactored to take into account DiscreteDistribution.

https://github.com/econ-ark/HARK/blob/master/HARK/ConsumptionSaving/ConsPortfolioModel.py#L707-L712

This case is probably missing from the automated test suite. This issue is for making the test and correcting this code.

llorracc commented 4 years ago

For future reference of anyone who takes on this task, let me point you to some lecture notes and a corresponding Mathematica notebook that shows how to construct equiprobable distributions that allow for correlations between two independent variables. It shouldn't be that hard to translate the Mathematica code into python.

http://www.econ2.jhu.edu/people/ccarroll/public/lecturenotes/AssetPricing/Portfolio-Multi-CRRA/

sbenthall commented 3 years ago

@Mv77 since you are working with the Portfolio model closely, maybe you are the best person to take a look at this. Is there any way the Distribution classes could be expanded to make this sort of operation easier?

sbenthall commented 3 years ago

For reference, the combineIndepDstn function: https://github.com/econ-ark/HARK/blob/master/HARK/distribution.py#L906

For this issue, there needs to be an implementation of a more sophisticated way to discretize correlated normal distributions....

sbenthall commented 3 years ago

See #120

sbenthall commented 2 years ago

See also https://github.com/econ-ark/HARK/issues/1106#issuecomment-1025908532

Mv77 commented 2 years ago

The easiest way to do this with current tools would be to add a "crash" state where income shocks and risky return draws would be very low. The crash state can happen with some probability p, and otherwise shocks are drawn from their usual distributions.

I might take a look after I am done with the newborn shocks issue.

mnwhite commented 4 months ago

The current ConsPortfolioModel handles arbitrary shock distributions using DiscreteDistribution, including correlation between income and returns. Closing.