sbenthall / SHARKFin

Simulating Heterogeneous Agents with Finance
6 stars 5 forks source link

Zero labor income for LUCAS0 population #208

Closed sbenthall closed 1 year ago

sbenthall commented 1 year ago

According the the LAP model, consumers should have no labor income. (see notes)

We have 'tried' to do this, by setting the initial pLvl values to 0 and the shocks to 0. (I think @alanlujan91 did this a couple months ago) https://github.com/sbenthall/SHARKFin/blob/master/simulate/parameters.py#L93-L98

But according to HARK, the pLvlInitMean parameters is the mean of log of the initial level of income. So currently, the LUCAS0 population has an income of 1. https://github.com/econ-ark/HARK/blob/876ede3a8de0ba2606a27f6b9b6d2ae42076f580/HARK/Calibration/Income/IncomeTools.py#L547

I've tried swapping in -float('inf') for this value, but perhaps predictably the resulting simulation throws a lot of errors. We need to compute not-normalized asset holdings of consumers to compute demand for shares, and this involves multiplying aNrm by the pLvl. So it's no wonder that having zero valued income levels causes problems.

ERROR: Agent desires nan shares

@llorracc I know HARK has been used to model the LAP case before. How has it dealt with the labor income?

llorracc commented 1 year ago

One way to think about this is that the LAP model of the microeconomic consumer's choice as the ratio of wealth to permanent income goes to infinity. If you have labor income of a penny a year, and wealth of $5 billion, only an infinitesimal amount of your future consumption will be financed by your income.

PerfForesightCRRA has solutions to the non-normalized perfect foresight model and for which labor income can be zero. @alanlujan91 should be able to help you figure out what to do

llorracc commented 1 year ago

PS. You should also do a deep dive into

Lucas-Asset-Pricing-Model. After the deep dive, you might consult Mateo about any further questions.

sbenthall commented 1 year ago

It does not look like that LAPM notebook uses HARK AgentType agents at all. So that is not terribly helpful.

The issue is that we need to have ConsPortfolioModel agents with no labor income. I'm not sure that's possible given that ConsPortfolioModel is built on the ConsIndShock model, which is all about labor shocks.

So while it may be useful to know the math, it won't help us unless there is a new HARK AgentType written to implement it. That seems like a rather larger lift than anybody anticipated.

What if we just set pLvlInitMean to a very low number? Like -1e5

llorracc commented 1 year ago

Yes, that's probably the right solution. It means that we will have to make sure the aGridMax variable is very large, and we will want to use Mateo's exponential decay to capture points beyond the max. @alanlujan91 and @Mv77 know how to do these things.

sbenthall commented 1 year ago

OK, thanks @llorracc . We'll try it this way.

I wonder if @Mv77 should start coming to our project meetings.

sbenthall commented 1 year ago

@llorracc

One way to think about this is that the LAP model of the microeconomic consumer's choice as the ratio of wealth to permanent income goes to infinity.

As we have noted elsewhere, we would like to initialize agent wealth at the mNrmStE, which is the ratio of wealth to permanent income.

Are you saying that we should choose parameters such that mNrmStE is infinite?

llorracc commented 1 year ago

No. In the Lucas model, target wealth is not infinity. There is no target level of wealth. The definition of an "equilibrium" is that the consumer wants to consume neither more than all the fruit, nor less than all the fruit. C=D. This is because in the Lucas model, the fruit rots so there's no point in leaving any of it unconsumed. And it is not possible, in aggregate, to consume more than all the fruit.

At the individual level, this just means that each consumer will want to consume an amount exactly equal to their (nonstochastic) income. But we can have consumers at different levels of income. So, for a consumer with income of $d{i}$ their wealth would be $P{i}= f(d_{i})$ (the formula in the notes). @Mv77 and @alanlujan91 should be able to help you understanding this. So, there will not be any distribution for the ratio of wealth to income. Everyone's ratio will be $P(f{i})/d{i}$. But there can be a distribution of income $d_{i}$ that is calibrated to empirical data on the distribution of income.

This all will be more interesting when we introduce permanent income uncertainty and the corresponding amount of impatience to make the aggregate amount of wealth match the aggregate $P/d$ ratio. In that case, there will be a distribution of the wealth-to-income ratio. But for your purposes, to start with, you will want to set everyone's income to 1, labor income risk to 0, and wealth to $P/d$.

sbenthall commented 1 year ago

@alanlujan91 's idea earlier was that wealth would be computed in terms of the total price of one's assets (trees).

It looks like the notes from section 4 onward normalize population and tree quantity both to 1. So the wealth would be $P$.

Think that in your above comment, you are using 'income' to refer to both dividends and labor income. So I suppose the ratio of wealth to dividend income is just the price/dividend ratio.

But I was reserving 'permanent income' for labor income. Now I'm seeing two different recommendations:

Proposal 1: Close-to-zero income.

What if we just set pLvlInitMean to a very low number?

Yes, that's probably the right solution.

Proposal 2:

But for your purposes, to start with, you will want to set everyone's income to 1, labor income risk to 0, and wealth to $P/d$

I'm confused by Proposal 2 because I thought that LAP wants labor income to be 0.

Setting wealth to be $P/d$ will mean that the consumers will start by owning $1/d$ trees, which violates the normalizing assumption about the population/tree ratio.

I agree that some consideration of the aggregates seems important here.

sbenthall commented 1 year ago

I see. The pLvl is arbitrary and 1 is both simple and small. Ok, makes sense.

205 is for the starting wealth level.

sbenthall commented 1 year ago

Fixed with https://github.com/sbenthall/SHARKFin/commit/95da6e5dc65b54db57f5f1205be64ebf056fbf9b

sbenthall commented 1 year ago

Because each unit of HARK money can be worth many AMMPS dollars ('dollars per hark money unit'), a constant income of 1 HMU has been shown to lead to large quarterly purchases of stocks. These purchases markedly exceed the normal daily trades from retail investors due to rebalancing, and so create a lot of distortion.

So it looks like we will need to address this issue of making labor income small.

alanlujan91 commented 1 year ago

income = 1; dollars_per_hark = 1500 -> simulation income = 1500 income = 1/dollars_per_hark -> simulation income = 1 ??

sbenthall commented 1 year ago

I like the elegance of that, but want to think it through...

...

llorracc commented 1 year ago

Seb,

I think you need to think harder about this, maybe with Alan's assistance. It is clear to me that you are confused about something, but not clear what you are confused about.

On Tue, May 23, 2023 at 9:08 PM Sebastian Benthall @.***> wrote:

I like the elegance of that, but want to think it through...

  • If pLvlInitMean = log ( 1 / dphm ) ...
  • And aNrm is chosen as the steady state equilibrium...
  • Then the total wealth of agents, measured in dollars, will be (1 / dphm) aNrm dphm = aNrm ...
  • ... meaning, that we would no longer be varying the relative size of the retail investor activity with the dphm parameter...

...

— Reply to this email directly, view it on GitHub https://github.com/sbenthall/SHARKFin/issues/208#issuecomment-1560316602, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKCK74CDDSURBLNW55DJCLXHVNPXANCNFSM6AAAAAAW5LFNUQ . You are receiving this because you were mentioned.Message ID: @.***>

--

sbenthall commented 1 year ago

@llorracc You're right. Setting pLvlInit to be small won't help anything. The problem is the size of rebalances relative to the income, which will be constant.

@alanlujan91 , I think that...

... essentially, what we would like is a working version of the PortfolioConsumerType with 0 income.

That currently does not exist in HARK.

Implementing an entirely new consumer household model at this stage is not something I'm eager to have as part of the project scope, but I don't see alternative strategies this point.

sbenthall commented 1 year ago

@alanlujan91 I suppose the alternative is to only consider the 'solution' at normalized $m \rightarrow \infty$.

Is either the consumption function or portfolio share function asymptotic?

sbenthall commented 1 year ago

After our team meeting this morning, my hunch now is that:

It also occurs to me, albeit hesitantly, that if building this new model in HARK is too burdensome, that prototyping new models like this is exactly what BARK is for. Once BARK is able to reproduce HARK results (the plan is to have that by the end of this month), I might try this out and see if it goes anywhere.

sbenthall commented 1 year ago

So maybe something like this:

image

sbenthall commented 1 year ago

A much clearer analysis is now here:

https://github.com/sbenthall/SHARKFin/blob/master/macro/Lucas%20Portfolio%20Agent%20Type.ipynb

Essentially, if we think of the problem in terms of a "staged" PortfolioConsumer problem, our problem is the same as before but with the labor income stage removed. Because there's no permanent income growth, there's no normalization step (as that is "part of" the labor income stage). Everything else is essentially as before, because what matters are the returns on the risky asset, and these are well defined in terms of the dividend shock, growth rate, and price-dividend ratio.

With either BARK or DARK, this should be easy to implement. It is less complex than the version of the portfolio agent with stochastic income shocks.

sbenthall commented 1 year ago

Matt White says this problem has easy mathematical solutions that could be hacked into HARK. Portfolio allocation and consumption are both constant in resources, which makes perfect sense.

Hacking up a HARK agent that does this is an option. But it wouldn't improve the HARK technology to do so.

sbenthall commented 1 year ago

Aha. Maybe we can just use the SequentialPortfolioConsumerType, but with an unemployment probability of 1.0 and employment income of 0. That should get us the asymptotic consumption and share functions. @alanlujan91 can you think of any reason why that wouldn't work? It seems easy to try.

With those as a function of only the expectations, then I think we'd expect very low trade volume. Basically fluctuating around the size of the dividend income itself. (until strange expectations set in.)

sbenthall commented 1 year ago

We are just going to go with the consumers having labor income and see what happens.