numeconcopenhagen / advmacrohet Goto Github PK
View Code? Open in Web Editor NEWCourse on solving heterogenous agent models
License: MIT License
Course on solving heterogenous agent models
License: MIT License
My question is regarding the third exercise from lecture 1, where a transitory chock is introduced in the model, giving the following budget constraint:
given that
I'm a bit unsure of how we deal with this, both directly in the code and theoretically.
Theoretically, do we just have a model where each period some fraction of the agents endure negative consumption even though the utility function is not really defined in this space?
If there is a tail-end risk of 0-consumption and infinitely negative utility how does that affect the expected utility in next period?
Implementation wise I ended up choosing a small std of
I feel like I might be missing something here. Hope you can help.
Best regards and thanks in advance,
Asker
Hi Jeppe,
This is not really related to the code so perhaps the wrong place to ask this question.
In the assignment, does the part about step-step explanation of analysis include stuff like parameter calibration and how we would solve the model if we had to?
Best,
Jacob
Hi Jeppe
Ill try one final question if you have time.
How do we compute MPC with endogenous labor supply. As I understand it, we would want income to be unchanged so that we can "shock it" using the code in the HANC model in GEModelToolsNoteBooks.
But how do we compute MPC with endogenous labor supply. Their income is endogenous so we can't shock it in the same way?
We would need to hold labor supply exogenous I think.
Hi Jeppe
While this may just be me misunderstanding matters, I noticed some weird stuff in the assignment.
Should the
Figures overwrite each other when trying to save impulse responses using
Maybe you add an f-string that accounts for the typename?
Hi Jeppe
Why is it that the maximum point for the a-grid is written as: par.w*par.a_max and not just par._a_max?
Best,
Jacob
Hi,
I wondered whether there might be a zeta missing in the numerator of the factor tilde(w)z/phi in eq. 8 of the assignment. Is that right? I haven't gone through the math in detail but intuitively I would've thought fixed heterogeneity in productivity should be accounted for there too.
I may v well have missed something though!
I seem to have a problem getting the block code to run properly. I have solved for the steady state, and that part is working, but running the model.test_path() command gives results that are very different from the steady state values (although they should be nearly identical).
I have tried to replace all lag() and lead() routines in the block-code by their respective ss. values (e.g. ss.q instead of lag(ini.q,q)). These values should be the same, considering that we are modelling the steady state only. Doing this helps!
So I guess, I have a problem getting the lag() and lead() routines to work properly. I use the exact same form for the routines as in the GEModelToolsNotebooks HANK block file, i.e.
lag(ini.var,var) for lags
lead(var,ss.var) for leads
Can anyone see what I'm doing wrong here?
Hi,
Maybe I remember my micro badly, or I've made a mistake in my model equations, but solving the model gives me a "K_clearing" and "L_clearing" of 0, but a "C_clearing" of 0.3 - which lead me to conclude that government consumption was missing from the market clearing equation for the goods market, i.e. that it should be:
This makes sense to me intuitively, however, is this a mistake?
Hi Jeppe
I was reading the Auclert et al. paper 2021a where they state the assumption the mass of agents always correspond to the stationry distribution. While this assumption seems fairly reasonable in steady state, I am uncertain how to interpret it when we are on the transition path.
Is this simply assuming that shocks are always distributed across agents corresponding to their stationary distribution regardless of other shocks to the economy.
Hope the question was somewhat understandable.
Best,
Jacob
In the assignment I tried a few different ways of solving for the transition path.
I stumbled upon an issue that puzzled me a bit.
I used four targets(model can be solved with less, but this was a test) which was:
How I wrote the government budget constraint matters for the solution. I tried:
With the first option, the linear approximation is fairly close to the non-linear path. That is not the case with the second option. I assume it is because dividing with something close to zero is bad idea numerically.
As a final note, when I solved the model with only two targets (NKPC and asset market clearing), the linear approximation was almost identical to the non-linear path. In all cases, all marking clearing conditions were satisfied and the zero-shock(giving sequence of steady values) seems to pass, but the non-linear path was slightly different between them.
Is the above just an issue of numerical precision?
I am unsure whether I should link the assignment code as this is part of the exam.
Best,
Jacob
Hi Jeppe
Some of us seems to have path dependancy in our model solution. That is - using different initial guesses result in different equilibria.
Should we see this as evidence of a code mistake? If not - do we simply choose one equilibrium for display in the assignment?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.