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

Initial configuration to better get at phase transition #256

Open
sbenthall opened this issue Jul 31, 2023 · 20 comments
Open

Initial configuration to better get at phase transition #256

sbenthall opened this issue Jul 31, 2023 · 20 comments
Assignees

Comments

@sbenthall
Copy link
Owner

There's something I've talked about with @mesalas that I would like to put down. It involves the configuration of several moving parts.

We are trying to get at the impact of the expectations parameters (attention and zeta) on our results. An issue is that other aspects of the model are dominating results. These other aspects include:

  • The relative market power (liquidity) of market makers and consumers. When the consumers outspend the market makers, the market makers are unable to ground the market price.
  • The consumers are making income and consuming, which adds and removes money from the system
  • The consumers can be starting far away from the steady state, which means that their early activity in the model is not in equilibrium but rather a function of initial conditions.
  • If the consumer market power is too small, the market makers dominate and we get the Lucas price trivially.

What would reduce these effects are:

  • Low DPHM. This will reduce the effects of income on the market price.
  • Start wealth close to steady state. So initial conditions don't bias the consumer activity.
  • Total consumer buying power balanced with market makers. So we are close to the phase transition.

So ideally, what we would do, I think, is:

  • Know/estimate the consumer state normalized wealth. $\hat{a}$. I need @alanlujan91 's help with this, or even to test if it exists for our parameters.
  • Set DPHM $d_h$ to something quite low.
  • Compute the effective consumer wealth in dollars $\hat{a}d_h$
  • Set the market maker size to something so that the market maker effective wealth is comparable to $\hat{a}d_h$. Will need to coordinate with @mesalas to figure out how mmsize relates to market maker effective wealth.
@sbenthall sbenthall added this to the v0.4.2 SPARK SHARK milestone Jul 31, 2023
@mesalas
Copy link
Collaborator

mesalas commented Aug 9, 2023

I had a discussion with Allan about how we should view the consumers. I have been seeing them as a sort of retail investors that trade in the market, but really we should be seeing them as a rather passive long term investor.

What I got from our discussion is that we expect them to do or affect the market much under normal conditions. However when the market does something unexpected (from the point of view of the consumers) they may start affecting the market.

@sbenthall
Copy link
Owner Author

Since simulation-based estimation of 'target wealth' isn't working, I've tried using an approach I think @llorracc suggested, which is to look at the intersection of the consumption function with another function of interest.

This code is in here:
https://github.com/sbenthall/SHARKFin/blob/master/macro/steady_state_mNrm.py

Winging this for now, what I'm looking for is the intersection of:

  • the consumption function, cFunc(mNrm)
  • the expected gain to wealth between after-consuming aNrm and the market resources of the next period mNrm:
    • $(m - c) (\alpha \mathbb{E}[\eta] + (1 - \alpha)R) + 1$, where the transitory income shock is 1 based on our parameterization of the problem.

The plot of this is interesting:
image

Essentially:

  • Resource poor agents will consume less than they expect to gain, to build wealth.
  • Resource rich agents will consume less than they expect to gain, because... well, I suppose there is no target wealth for this population.
  • There is a small region in which the agents will consume more than they expect to gain, in between these two regions.

In other words, there are two points of intersection. This is unexpected.

On the other hand, I could easily be measuring the wrong thing here. This does seem more promising an approach than trying to get the target wealth through simulation, since there may well be no target wealth at all. I'm sure an Economist could do a better job of this than I'm doing, hint hint @alanlujan91 .

@llorracc
Copy link

llorracc commented Aug 10, 2023 via email

@sbenthall
Copy link
Owner Author

@llorracc I do understand that this problem is in totally in your wheelhouse. And I am frequently referring back to the Bufferstock paper and looking for clues to help with this problem. I'm sure you could illuminate your Bufferstock paper for me in lots of ways.

However, I also understand that since we are using a Portfolio model with endogenous portfolio selection and risky returns, the results from your Bufferstock paper are not going to tell us the answer directly. You have said yourself that to do an analysis of the Portfolio model comparable to your Bufferstock paper would be its own standalone paper.

I don't think we need to have that kind of paper in hand to do the SPARK paper that we are working on, because with a simulation based study we have already abandoned the possibility of analytically tractable results. However, we still need to understand the behavior of the consumers, and luckily we should in principle be able to determine this by examining the solution objections and simulating them.

Naturally, in the writing we will connect what we're doing to your Bufferstock work.

Again, @alanlujan91 is active on this paper and a deeper specialist in this area. In our many research conversations he has clarified many of these points and I hope he'll engage on this issue now that he's at large and in charge.

One thing that occurs to me is that, if I'm not mistaken about this double-intersection point, then maybe we can use it as part of the narrative somehow. Something like:

  • Start the consumers at the 'target wealth' implied by the first intersection point
  • Notice that if the consumers become wealthier than the second intersection point, their behavior changes and they begin accumulating.

If consumers deciding to accumulate winds up dragging shares out of the institutional investors and crashing the economy, that's a morality tale!

@llorracc
Copy link

llorracc commented Aug 10, 2023 via email

@sbenthall
Copy link
Owner Author

Helpful feedback from @llorracc in the notes below. Bottom line is that if we want the consumers to have finite target wealth, we might be able to get it if we adjust the parameters to make the consumers more impatient, and give them labor income uncertainty. We can break the link between the 'lucas price' parameters (discount factor, risk aversion) and consumers if necessary (it may even be advised, because 'lucas pricers' are 'poised').

Handing this off to @alanlujan91 until we can all meet in Switzerland about this.

  • To have a finite target wealth, we probably need the Perfect foresight Absolute Impatience Condition to hold. Meaning, thorn < 1, but thorn should be calculated with the risky average rate of return. This is heuristic, but should to the ballpark.
  • If we have discount factor heterogeneity, the we want the most patient person still needs to match the AIC. Discount factor heterogeneity might get us to a more realistic distribution of wealth.

image

  • Risk is what makes the consumers change from an AIC-driven spending-to-zero, and a finite target wealth. In the Bufferstock model, the risk comes from income uncertainty.

  • Contrary to what we've been doing, the discount factor and risk aversion parameters used for the Lucas price determination need not match the discount factor and risk aversion for the consumer population. The institutional investors may well be more patient than the consumers.

  • The simulation result I was getting where portfolio consumers with no labor income uncertainty just hover around their initial level of wealth is not a bug. That's actually a result from Lucas 1978 "Asset Prices in an Exchange Economy".

I note:

  • Risk in our model comes from the returns, not labor income uncertainty.
    • We could reintroduce labor income uncertainty, but do we need to?
  • We have been constrained by the Lucas pricing theory. Ideally, the parameters match both constraints.

image

@alanlujan91
Copy link
Collaborator

866c12ba-ad02-4149-b9f6-5fb20581fe17

Below zero, E[m'] expected cash on hand tomorrow is greater than cash today. Above zero, coh today is greater than what you expect to have tomorrow.

@sbenthall
Copy link
Owner Author

Cool - -what's the x axis there? market resources?

@sbenthall
Copy link
Owner Author

Thanks for confirming this @alanlujan91

I think we have our new course of action settled.

We have two points of intersection on that plot, $x_0$ and $x_1$.

For $m &lt; x_1$, there is a region of attraction around point $x_0$. $x_0$ is the closest thing that we have to an equilibrium point. If the consumers stay in this region, then they will have finite target wealth and the number of risky shares held by the consumers should stay finite.

For $m &gt; x_1$, then in expectation the consumers start to accumulation infinite wealth. We know that in this case, the consumers collect all the risky shares from the institutional investors and break the market.

If we initialize the consumers with market resources $x_0$, then we have a story about how the system is starting in equilibrium. We would expect market crashes to come if and only if endogenous behavior or exogenous shocks push the system out of the region of attraction.

What I don't think we know yet, which would be nice to know, is if in the USUAL conditions the ergodic distribution is settled around this point of attraction, or if the exogenous shocks push the system into the second regime. If the latter is the case, we don't really have the equilibrium it looks like we do.

Is there a way to test for this either analytically or numerically given the model?

@sbenthall
Copy link
Owner Author

Ok, I've been analyzing this a bit more.

Consider the two points of intersection $x_0$ and $x_1$. The first is the attractor of the attraction region for mNrm. The second is the boundary of the attraction region for mNrm.

The good news is that given the current configuration, if we start wealth close to $x0$, then there is indeed an equilibrium distribution of wealth. It looks like this:
image

We can divide the population up into the 'upper' region, for whom mNrm > $x_1$, the 'middle' region for whom $x_0$ < mNrm < $x_1$, and the lower region for whom mNrm < $x_0$.

Essentially, what happens (here, assuming idiosyncatic risky shocks) is that some percentage of the population escapes the attractor region and begins accumulating, but the rest of the population remains in the attractor region (the middle and lower sections).

image

The total percentage of resources owned by each 'class' is also stable.

image

The reason why the 'upper' class doesn't just keep accumulating ad infinitum disrupting the equilibrium distribution of wealth is that, in this configuration, we have only a ~.995 chance of survival. (We are using quarterly numbers here). So, the rich get richer, but then they die. And in this version of the simulation (which is done just using HARK, with no SHARKFin stuff added), their extra wealth just disappears.

Theoretically, we could move forward with the SHARKFin simulation by choosing a starting wealth distribution reflective of the equilibrium wealth distribution, and proceeding with the experiment. There is one small and one large obstacle to this.

The small problem is that the equilibrium wealth distribution is not exactly log-normal. It's got a funky shape. If we use the HARK distribution classes, we will be getting only close-to-equilibrium, not true-equilibrium, starting wealth.

The larger problem is that I think we've managed to forget to factor mortality into both the Lucas pricing equation (including mortality rate as part of effective discount factor) and the way SHARKFin handles risky asset ownership (because agents that die do not immediately sell off their assets to the broker; there may be a bug where agents that accumulate and then die maintain some inaccurate record of owned shares?).

You might think the easy answer is to just turn off mortality entirely. But then the effective discount rate of the HARK agents gets closer to 1, and their solution changes, so they no longer have an attractor region of wealth.

Basically, we haven't been thinking through how mortality of agents matters in our model, and we have to answer those questions.

@llorracc
Copy link

llorracc commented Oct 12, 2023 via email

@sbenthall
Copy link
Owner Author

ok @llorracc but what about if there is risk in labor and/or returns? And, beyond that, portfolio allocation?

If there isn't a theorem for this already it would be pretty easy to establish it one way or another given the current tools and computing power available.

@llorracc
Copy link

llorracc commented Oct 12, 2023 via email

@sbenthall
Copy link
Owner Author

The context here is:

  • The SHARKFin simulation.
  • We're using portfolio choice consumers.
  • For the results I posted today, we have had zero labor risk, but risky assets. This results in the (perhaps interesting) attractor region in market resources: Initial configuration to better get at phase transition #256 (comment)
  • However, it has been unknown if this results in an equilibrium wealth distribution.
  • Today, I found (numerically) that it does have an equilibrium wealth distribution, when there is death-and-replacement
  • When I remove mortality (LivPrb = 1) with the current discount factor, CRRA, etc., the impatience condition is violated and there is no attractor region in consumer wealth.
  • Open questions are:
    • Is there an alternative configuration of the portfolio choice agent with no labor income and no mortality which has an equilibrium wealth distribution?
    • If not, can we get an equilibrium wealth distribution by adding labor uncertainty to the portfolio choice agent?
    • If not, how can we think about mortality in the context of the Lucas pricing 'usual' expectations?

@sbenthall
Copy link
Owner Author

@alanlujan91 's made the call -- we are bringing back in labor income uncertainty.

@alanlujan91 -- what do you think we should do about mortality?

@sbenthall
Copy link
Owner Author

@alanlujan91 -- what do you think we should do about unemployment probability?

In general, it looks like the default dashboard uses the full suite of 'default' HARK values. These seem to complicate the story we're telling. But when I've tried turning some of these 'off', I get errors in the HARK solver.

{'AdjustPrb': 1.0,
 'AgentCount': 10000,
 'BoroCnstArt': 0.0,
 'CRRA': 6,
 'CubicBool': False,
 'DiscFac': 0.9,
 'DiscreteShareBool': False,
 'IncUnemp': 0.3,
 'IncUnempRet': 0.0,
 'LivPrb': [0.98],
 'MaxKinks': 400,
 'NewbornTransShk': False,
 'PerfMITShk': False,
 'PermGroFac': [1.01],
 'PermGroFacAgg': 1.0,
 'PermShkCount': 7,
 'PermShkStd': [0.1],
 'Rfree': 1.03,
 'RiskyAvg': 1.08,
 'RiskyCount': 5,
 'RiskyStd': 0.2,
 'ShareCount': 25,
 'T_age': None,
 'T_cycle': 1,
 'T_retire': 0,
 'TranShkCount': 7,
 'TranShkStd': [0.1],
 'UnempPrb': 0.05,
 'UnempPrbRet': 0.005,
 'aNrmInitMean': 0.0,
 'aNrmInitStd': 1.0,
 'aXtraCount': 200,
 'aXtraExtra': [None],
 'aXtraMax': 100,
 'aXtraMin': 0.001,
 'aXtraNestFac': 1,
 'cycles': 1,
 'neutral_measure': False,
 'pLvlInitMean': 0.0,
 'pLvlInitStd': 0.0,
 'sim_common_Rrisky': True,
 'tax_rate': 0.0,
 'vFuncBool': False}

I've added something to the dashboard that produces the target wealth numerically.
https://github.com/sbenthall/SHARKFin/blob/master/macro/dashboard_default.ipynb

I'm also working on a separate notebook for displaying target wealth over a grid of values, but am running into challenges related to these basic ones about our simulation configuration.

@sbenthall
Copy link
Owner Author

The issue I'm getting seems to depend on setting the PermGroFac to 1.0, which is definitely something we want to do. (We don't want correlations in permanent income!)

econ-ark/HARK#1376

@sbenthall
Copy link
Owner Author

My mistake -- I was setting PermGroFac to 0.0. Silly. Ok, but we still need to settle other starting config details.

@alanlujan91
Copy link
Collaborator

Mortality: Agents should perhaps think they are not infinitely lived: LivPrb = 0.98 or whichever the default is. However, agents should not actually die during simulation, they just believe they could and this affects their portfolio choice.

Unemployment: Again, these beliefs should inform the agent's decision, and I think we describe this as being more "realistic". At the end of the day, Unemployment just means a much lower income shock, since the replacement factor is 0.3.

PermGroFac: Correct, we should set this to 1. Which means permanent income has no drift.

@sbenthall
Copy link
Owner Author

On consideration: LivPrb = 1. UnEmp = none

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

No branches or pull requests

4 participants