econ-ark / HARK

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

Risky returns---discrete or continuous? age varying or constant? subjective or objective? #1255

Closed Mv77 closed 4 months ago

Mv77 commented 1 year ago

I have been looking into how we draw risky return realizations: https://github.com/econ-ark/HARK/blob/57a7af2d3ea9c45afa21ab9e0b16e860f17794cc/HARK/ConsumptionSaving/ConsRiskyAssetModel.py#L306-L335

There are various things that I find awkward: 1) We are drawing from continuous lognormals that we create each time: if we want to draw from a lognormal, we might just want to create the object, store it, and draw from it every time. Not call the constructor each time. Also, drawing from the continuous (as opposed to the discrete, approximated) distribution is inconsistent with what we do for income: https://github.com/econ-ark/HARK/blob/57a7af2d3ea9c45afa21ab9e0b16e860f17794cc/HARK/ConsumptionSaving/ConsIndShockModel.py#L2258-L2259 (Note that IncShkDstn is discrete). This last point also means that the model we are solving (discrete risky returns) is not the one we are simulating (continuous risky return).

2) Age-varying but not really: we are allowing users to specify a time-varying distribution for the risky asset return, and we can solve models where that is the case. But then the simulation code assumes that if the distribution is age-varying, then it must be a miss-perception by the agent. We can only draw from an age-invariant distribution that the user---to his surprise---must have specified using RiskyAvgTrue and RiskyStdTrue.

My own opinion is that we should only draw from a (possibly time-varying) RiskyDstn that is the discrete approximation used to solve the model, and is created and stored using update_RiskyDstn.

If someone (myself!) wants to solve a model where beliefs differ from reality he can do

agent = RiskyAssetConsumerType(**subjective_params)
agent.solve()
agent.RiskyAvg, agent.RiskyStd = TrueRiskyAvg, TrueRiskyStd
agent.update_RiskyDstn()
agent.initialize_sim()
agent.simulate()

However, I know people might feel differently and so I wanted to open this for discussion @alanlujan91, @llorracc.

PS: I think the age varying subjective stuff comes from back in the day when we were working on the housing project.

Mv77 commented 1 year ago

Forgot to say: The drawing thing bakes in the lognormality assumption. If we did what I am suggesting, RiskyDstn could be any discrete distribution. E.g, a mixture of an approximated lognormal with a crash-state!

llorracc commented 1 year ago

@Mv77 I'm on board with everything you say.

But this is all connected to my grand scheme in which the right way to construct a model is just to build it backwards from T, in a way that a user can specify (and later retrieve) anything they want. I'd rather not put a lot of effort into engineering marginal improvements on the bad way we do things now if there is a prospect of a revised way of doing things that will not be subject to the same problems.

This question is fodder for our next Zoom meeting.

Mv77 commented 1 year ago

I am glad that we agree. And yes, this very much fits some of the goals that you have expressed (like allowing everything to be age-varying in principle).

I am less sympathetic to the argument that we should not work on this until the great rework happens. I think the index-distribution way of doing things is clear and functional. The issue is that it is not being used here! And implementing it might have a sufficiently low marginal cost that the marginal improvement might be worth it!

I might implement the change myself at some point---I think it would be easy to do---but wanted to hear what you all thought.

llorracc commented 1 year ago

I am by no means discouraging you from doing this if you perceive it to be useful. Just wanted to put it in the context of future (perhaps distant) aspirations.

On Thu, Apr 6, 2023 at 6:26 PM Mateo Velásquez-Giraldo < @.***> wrote:

I am glad that we agree. And yes, this very much fits some of the goals that you have expressed (like allowing everything to be age-varying in principle).

I am less sympathetic to the argument that we should not work on this until the great rework happens. I think the index-distribution way of doing things is clear and functional. The issue is that it is not being used here! And implementing it might have a sufficiently low marginal cost that the marginal improvement might be worth it!

I might implement the change myself at some point---I think it would be easy to do---but wanted to hear what you all thought.

— Reply to this email directly, view it on GitHub https://github.com/econ-ark/HARK/issues/1255#issuecomment-1499702129, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKCK75BQERQUUCTSDZJIP3W747JJANCNFSM6AAAAAAWVVCOQE . You are receiving this because you were mentioned.Message ID: @.***>

--

Mv77 commented 1 year ago

Fixed in #1262.

alanlujan91 commented 4 months ago

I left a comment somewhere on the github-verse about this issue/pr while trying to determine when we did away with RiskyAvgTrue, but I don't know where it posted or if any of you received it.

I think I understand what the change was, but just wanted to clarify. @Mv77

Now, when we want to put in subjective beliefs, we solve a model given subjective belief parameters.

Then, when we want to simulate using actual process, we re-set the parameters, recreate the distribution, and then simulate. Correct?

llorracc commented 4 months ago

The motivating idea that we had in mind when we set up this infrastructure was precisely a context in which perceptions were different from reality. What we wanted to capture was that as people get older, they become more risk averse. We wanted to do this to explain why old people invest less in stocks than one might expect. However, the math of handling age-varying relative risk aversion is super ugly. So my proposal was, instead, to have people's perceptions of uncertainty get worse as they get older, which accomplishes the same thing as age-varying relative risk aversion but keeps the problem homothetic and normalizable.

But the natural way to simulate this would be to draw shocks that correspond to reality and not to incorrect perceptions of reality.

Bottom line: The user should be able to choose whether to simulate with the perceived or with the "correct" calibration. If we can't do that now, I hope it will not be too hard to add this choice.

Mv77 commented 4 months ago

Alan: yes

Chris: I see what you mean, and that can be achieved with the current tools. The design philosophy that I try to apply is that there should not be many options for specialized cases, but rather a few flexible tools that can be manipulated easily.

The previous way of doing things required that you specify true and subjective distributions always. It also baked in assumptions about these distributions. 9/10 times that a user solves a problem like this, the two distributions will match, and the options will just be an annoyance.

The current way of doing things simply requires the use who wants to, to solve the model, and then change the distribution before simulating, to achieve the same goal. I find that more intuitive and clearer.

On Thu, Feb 22, 2024, 6:46 PM Christopher Llorracc Carroll < @.***> wrote:

The motivating idea that we had in mind when we set up this infrastructure was precisely a context in which perceptions were different from reality. What we wanted to capture was that as people get older, they become more risk averse. We wanted to do this to explain why old people invest less in stocks than one might expect. However, the math of handling age-varying relative risk aversion is super ugly. So my proposal was, instead, to have people's perceptions of uncertainty get worse as they get older, which accomplishes the same thing as age-varying relative risk aversion but keeps the problem homothetic and normalizable.

But the natural way to simulate this would be to draw shocks that correspond to reality and not to incorrect perceptions of reality.

Bottom line: The user should be able to choose whether to simulate with the perceived or with the "correct" calibration. If we can't do that now, I hope it will not be too hard to add this choice.

— Reply to this email directly, view it on GitHub https://github.com/econ-ark/HARK/issues/1255#issuecomment-1960523309, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGTULS35EJ3R5ZL34PM6ST3YU7KENAVCNFSM6AAAAAAWVVCOQGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNRQGUZDGMZQHE . You are receiving this because you were mentioned.Message ID: @.***>

llorracc commented 4 months ago

Good; it sounded from the previous discussion as though at some point the option of having a different sim than sol parameterization might have been lost.

On Thu, Feb 22, 2024 at 7:39 PM Mateo Velásquez-Giraldo < @.***> wrote:

Alan: yes

Chris: I see what you mean, and that can be achieved with the current tools. The design philosophy that I try to apply is that there should not be many options for specialized cases, but rather a few flexible tools that can be manipulated easily.

The previous way of doing things required that you specify true and subjective distributions always. It also baked in assumptions about these distributions. 9/10 times that a user solves a problem like this, the two distributions will match, and the options will just be an annoyance.

The current way of doing things simply requires the use who wants to, to solve the model, and then change the distribution before simulating, to achieve the same goal. I find that more intuitive and clearer.

On Thu, Feb 22, 2024, 6:46 PM Christopher Llorracc Carroll < @.***> wrote:

The motivating idea that we had in mind when we set up this infrastructure was precisely a context in which perceptions were different from reality. What we wanted to capture was that as people get older, they become more risk averse. We wanted to do this to explain why old people invest less in stocks than one might expect. However, the math of handling age-varying relative risk aversion is super ugly. So my proposal was, instead, to have people's perceptions of uncertainty get worse as they get older, which accomplishes the same thing as age-varying relative risk aversion but keeps the problem homothetic and normalizable.

But the natural way to simulate this would be to draw shocks that correspond to reality and not to incorrect perceptions of reality.

Bottom line: The user should be able to choose whether to simulate with the perceived or with the "correct" calibration. If we can't do that now, I hope it will not be too hard to add this choice.

— Reply to this email directly, view it on GitHub https://github.com/econ-ark/HARK/issues/1255#issuecomment-1960523309, or unsubscribe < https://github.com/notifications/unsubscribe-auth/AGTULS35EJ3R5ZL34PM6ST3YU7KENAVCNFSM6AAAAAAWVVCOQGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNRQGUZDGMZQHE>

. You are receiving this because you were mentioned.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/econ-ark/HARK/issues/1255#issuecomment-1960576156, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKCK73IQ6V5CLB5GA37ARDYU7QMLAVCNFSM6AAAAAAWVVCOQGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNRQGU3TMMJVGY . You are receiving this because you were mentioned.Message ID: @.***>

--

alanlujan91 commented 4 months ago

I might have been too busy to look at this change when it happened, so the feature is still there, it just is done differently. I do think this is a good approach that also forces users to know exactly how they are making simulation different from beliefs.