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

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

Closed
Mv77 opened this issue Apr 6, 2023 · 10 comments

Comments

@Mv77
Copy link
Contributor

Mv77 commented Apr 6, 2023

I have been looking into how we draw risky return realizations:

def get_Risky(self):
"""
Sets the attribute Risky as a single draw from a lognormal distribution.
Uses the attributes RiskyAvgTrue and RiskyStdTrue if RiskyAvg is time-varying,
else just uses the single values from RiskyAvg and RiskyStd.
Parameters
----------
None
Returns
-------
None
"""
if "RiskyDstn" in self.time_vary:
RiskyAvg = self.RiskyAvgTrue
RiskyStd = self.RiskyStdTrue
else:
RiskyAvg = self.RiskyAvg
RiskyStd = self.RiskyStd
# Draw either a common economy-wide return, or one for each agent
if self.sim_common_Rrisky:
self.shocks["Risky"] = Lognormal.from_mean_std(
RiskyAvg, RiskyStd, seed=self.RNG.integers(0, 2**31 - 1)
).draw(1)
else:
self.shocks["Risky"] = Lognormal.from_mean_std(
RiskyAvg, RiskyStd, seed=self.RNG.integers(0, 2**31 - 1)
).draw(self.AgentCount)

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:

    # Get random draws of income shocks from the discrete distribution
    IncShks = IncShkDstnNow.draw(N)

    (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
Copy link
Contributor Author

Mv77 commented Apr 6, 2023

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
Copy link
Collaborator

llorracc commented Apr 6, 2023

@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
Copy link
Contributor Author

Mv77 commented Apr 6, 2023

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
Copy link
Collaborator

llorracc commented Apr 6, 2023 via email

@Mv77
Copy link
Contributor Author

Mv77 commented May 5, 2023

Fixed in #1262.

@Mv77 Mv77 closed this as completed May 5, 2023
@alanlujan91
Copy link
Member

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?

@alanlujan91 alanlujan91 reopened this Feb 22, 2024
@llorracc
Copy link
Collaborator

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
Copy link
Contributor Author

Mv77 commented Feb 23, 2024 via email

@llorracc
Copy link
Collaborator

llorracc commented Feb 23, 2024 via email

@alanlujan91
Copy link
Member

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.

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

No branches or pull requests

3 participants