-
Notifications
You must be signed in to change notification settings - Fork 5
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
Set starting aNrm for Lucas population near equilibrium #205
Comments
SHARKFin/simulate/parameters.py Lines 10 to 32 in 9140b17
This depends on the ordering of the methods. If you see the method above, However, I notice that there are more than 1 |
Hmm. I think 'solve' got called 10 times when I ran:
(I got 10 copies of the Thorn, etc., output) I think that's using the I wonder if this is slowing down the tests as well. |
Are we solving anywhere else after creating the population? |
SHARKFin/sharkfin/population.py Lines 280 to 299 in 9140b17
Seems like we are solving the equivalent ind_shock agent for every agent, this probably shouldn't be happening |
Aha. That could be it. I think we're doing this because @llorracc was interested in the mNrmStE value for some reason. I guess it could be done once for each agent class/type, if needed. |
I've tested commenting out that 'solve' use, and that's indeed it. For G.G. Shark I'm going to hackily disable this code. We should figure out how to really fix this for FIRE SHARK. |
Yes, I am interested in |
Monday's discussion, and especially @alanlujan91 's point about starting wealth values, reminded me why we computed this: I think the idea was that we would initialize agents with starting wealth calibrated to the normalized market asset holdings at steady state equilibrium (mNrmStE) so that we avoid the effects that @alanlujan91 was pointing to. See #30 I believe the reason why we were solving the agent twice is that mNrmStE is computed when an IndShockConsumerType is solved. But it is not computed when a RiskyPortfolioConsumerType (or whatever) is solved. (I believe the mNrmStE value of the IndShockConsumerType is only approximately correct for the equivalent RiskyPortfolioConsumer). |
Well, if we don't compute mNrmStE for the PortfolioConsumerType, we
should.
It's a pretty easy calculation (as long as the parameters satisfy all the
required patience conditions).
…On Tue, Apr 4, 2023 at 2:59 PM Sebastian Benthall ***@***.***> wrote:
Monday's discussion, and especially @alanlujan91
<https://github.com/alanlujan91> 's point about starting wealth values,
reminded me why we computed this:
#199 (comment)
<#199 (comment)>
I think the idea was that we would initialize agents with starting wealth
calibrated to the normalized market asset holdings at steady state
equilibrium (mNrmStE) so that we avoid the effects that @alanlujan91
<https://github.com/alanlujan91> was pointing to. See #30
<#30>
I believe the reason why we were solving the agent twice is that mNrmStE
is computed when an IndShockConsumerType is solved. But it is not computed
when a RiskyPortfolioConsumerType (or whatever) is solved. (I believe the
mNrmStE value of the IndShockConsumerType is only approximately correct for
the equivalent RiskyPortfolioConsumer).
—
Reply to this email directly, view it on GitHub
<#205 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKCK75YNSAL4CMQUYN7BWLW7RVPPANCNFSM6AAAAAAWC3MG4Y>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
- Chris Carroll
|
I can add including the calculation of mNrmStE to PortfolioConsumerType to my to do list. I agree that it would be more efficient for Portfolio agent to do this calculation rather than having to create and solve a separate IndShock agent just for this calculation. |
Thank you @alanlujan91 ! I wonder what the right general way to architect this sort of thing is. |
@alanlujan91 Is the formula for I'm wondering because I'm wondering how this interacts with the near-zero income point. #208 |
|
What if rather than trying to do something too clever, we got the equilibrium/starting wealth value by:
Then take that aNrm value and use it as the initial aNrm for all the agents in the big simulation. Do you think that would work, @alanlujan91 ? |
this could work, although I'm not sure if we have infrastructure for |
Well, the easiest way to do it is just to find the intersection of the
consumption function and the "expected sustainable consumption" locus. The
latter is defined by c = 1 + E[R-1]/E[R]. where E[R] is the expected
portfolio weighted rate of return. This is basically the $\Delta m^{e}=0$
locus in [TractableBufferStock](
https://llorracc.github.io/TractableBufferStock/#x1-130002.2.9). Requires
no simulation. It's not exactly "mNrmStE" but very close to it.
…On Thu, Apr 20, 2023 at 2:08 PM Alan Lujan ***@***.***> wrote:
this could work, although I'm not sure if we have infrastructure for simulate
until aNrmAvg converges
—
Reply to this email directly, view it on GitHub
<#205 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKCK72RFWCTXQIXC6VI3QLXCF3SVANCNFSM6AAAAAAWC3MG4Y>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
- Chris Carroll
|
Cool thanks for pointing that out @llorracc |
Just as a short term fix.... This script simulates forward 3000 agents of our Lucas configuration for 3000 time periods, then plots the mean of their (natural) log https://github.com/sbenthall/SHARKFin/blob/master/macro/steady_state_mNrm.py Here is the output from that: While it's still quite choppy, I'll set the starting @alanlujan91 any improvement on this rough cut is of course most welcome. |
@sbenthall this is a good start, although now that we have this we should set aNrmIntMean to 6 and see if it stays around 6. |
Related to #204
solve_distributed_agents
callssolve()
on each AgentTypeSHARKFin/sharkfin/population.py
Lines 258 to 262 in cd70a7a
When we have multiple AgentTypes 'per type' (i.e.
num_per_type
), this introduces unnecessary computation, because the same solution can be used across different AgentTypes.The text was updated successfully, but these errors were encountered: