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

Monte Carlo Simulator that accepts aggregate blocks #1471

Open
sbenthall opened this issue Jul 10, 2024 · 12 comments
Open

Monte Carlo Simulator that accepts aggregate blocks #1471

sbenthall opened this issue Jul 10, 2024 · 12 comments
Milestone

Comments

@sbenthall
Copy link
Contributor

We now have a Monte Carlo simulator for an AgentType which is generic to model equations.
These equations are passed in as 'blocks'.
This functionality is limited to 'micro' economic problems, because the simulator does not handle cases where agents interact.

A natural next step would be to extend the Monte Carlo simulation functionality to allow for the definition of Aggregate, 'Market' or 'Economy' blocks, which would be very similar in spirit to the HARK 0.x Market class.

I believe this would be possible to do in 10 hours of work or less.

What would be most useful, before starting this work, is having on hand an example, in mathematical equations of the simplest possible compelling Market or Economy example. I believe that this might be something like a Cobb Douglas function.

Could somebody please advise me on where to look for the details of such a canonical market model?

I know Krusell Smith would be great to do eventually, but of course it would be best to start with something simpler.
Extending the more basic functionality to the more complex model might be a good grad student task.

@sbenthall sbenthall added this to the 1.0.0 milestone Jul 10, 2024
@Mv77
Copy link
Contributor

Mv77 commented Jul 17, 2024

The simplest model with micro-heterogeneity is possibly the "Aiyagari Model"

Lots of old integrals math in there but it amounts to including the equilibrium restriction that
$$\texttt{Rfree} = F(\int a_{i,t} di)$$ where $F(\cdot)$ can be something simple like $F(x) = 1 + x^{0.33 - 1}$, adequately scaled so that the Rfree ultimately makes sense and is not like... 5.

There are no aggregate shocks and, since with enough agents the integral should be constant, this is a model in which the conditions of every individual agent change (idiosyncratic risk) but the macro aggregates are constant. That is why it is simpler than, e.g., Krusell-Smith

@Mv77
Copy link
Contributor

Mv77 commented Jul 17, 2024

Intuition is that R is the price of renting capital (the funds that agents save). If there is a lot of saved funds available, renting them should be cheaper.

Think of $F(\cdot)$ as the price that some external entity (in this case a firm) is willing to pay to agents for renting their savings for one period. Impose that and you have an equilibirum model.

@mnwhite
Copy link
Contributor

mnwhite commented Jul 17, 2024 via email

@sbenthall
Copy link
Contributor Author

Thanks @Mv77 that's perfect.

I'm linking here to the dolark version of this model just for reference, since it's a succinct representation of the problem:

https://github.com/EconForge/dolark.py/blob/master/examples/ayiagari.yaml

@sbenthall
Copy link
Contributor Author

sbenthall commented Jul 17, 2024

It's a little hard to unpack the forward transition equations from the original paper, but I believe it, for the individual agent:

$$z = lw + (1+r)a$$

$$c < z + b$$

$$a' = z - c$$

And at the aggregate level:

$$K = \sum_N a$$

$$r = \alpha (K/N) ^ { \alpha - 1}$$

$$w = (1-\alpha)*(K/N)^\alpha$$

EDIT: The equation for $r$ has been edited as per @mnwhite suggestion below.

CRRA utility as before.

I believe this is sufficient for the Monte Carlo simulation for arbitrary decision rules (which may be out of equilibrium).
I wonder if you agree.

@mnwhite
Copy link
Contributor

mnwhite commented Jul 17, 2024 via email

@sbenthall
Copy link
Contributor Author

How would you like it expressed, @mnwhite ?

@mnwhite
Copy link
Contributor

mnwhite commented Jul 17, 2024 via email

@sbenthall
Copy link
Contributor Author

I agree. Good point, @mnwhite

@Mv77
Copy link
Contributor

Mv77 commented Jul 17, 2024

I'd suggest setting $N$ to 1 and forgetting about wages. Receiving wages as an input that affects the income of agents might require defining a new agent type. I'd just take income to be whatever the baseline income process of ConsIndShock is.

That way the only real equilibrium restriction to be satisfied would be $F\left ( \int a_{i,t}(\texttt{Rfree}) di \right) = \texttt{Rfree}$. Call it a "simplified Aiyagari" just to start testing the framework with a single simple equation.

@mnwhite
Copy link
Contributor

mnwhite commented Jul 17, 2024 via email

@sbenthall
Copy link
Contributor Author

@Mv77 The point of this issue is to develop (a) a python configuration object which contains model equations for aggregation and (b) changes to the (general) Monte Carlo simulator to enable forward simulation with such a configuration object. There are no AgentType objects involved here at all.

So it's the aggregation, not the equilibrium condition, which I'm getting at here.

Out of scope for this issue is to write a solver that can take these equations and derive a solution. That's perhaps far ahead. It would follow on #1438

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

3 participants