-
Notifications
You must be signed in to change notification settings - Fork 148
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
Permanent Shocks #21
Comments
Dear Valter, Thank you for raising your issue. Could you send a minimal code snippet that I can run that gets you the error? Say two blocks that you aggregate and compute a nonlinear transition for? And then maybe also show the full error message? Hopefully we can figure it out then! Ludwig |
Dear Ludwig Thank you for your reply. The model that I am trying to do is a neoclassical model with heterogeneous labor supply and permanent heterogeneity across discount factors and permanent ability. To do so, I imported the household block with labor choice: and then added the corresponding hetoutputs and hetinputs:
Then, I add firms and government, and the corresponding market clearing conditions:
Since TFP is normalized to 1, and we need to calibrate after K/Y, I created a new block for those ratios:
After all this, I added the ingredients for the heterogeneity. Since I am trying to replicate a model with 3 betas and 2 different permanenent abilities, what I did was to aggregate them in the same way as in the KS example.
Then, since the betas parameters that I use for calibration, in order to avoid having to write "beta_beta1_ability_1", etc..., I added a simple block that maps the values from the calibration dictionary to the household block:
and to help to build the calibration dictionary, I created a function to add each of the new values abilities and betas (flexible to the number of points in the ability grid):
So the model is created as: For this calibration, we get a steady state:
Then, if I apply a nonlinear MIT shock on G, the model also converges:
However, if I try to add the line "ss_initial", it does not run. I get the error message: ValueError: max() arg is an empty sequence
I believe the problem is precisely in one of the simple blocks I added, for example the "betas" block.
However, for the purpose of my learning process, I would like to know and understand why the nonlinear impulse responses work without the 'ss_initial' argument when I run the code above, and with that, it doesn't. |
Hi everyone.
I'm attempting to apply a permanent shock in a Neoclassical Model with heterogeneous labor supply and variation across discount factors and permanent abilities.
The model functions perfectly for a transitory fiscal shock. However, when it comes to the permanent fiscal shock, I encounter an issue. After calculating the new steady state following the shock, which I've termed "ss_terminal," I use the following code:
I consistently receive the following error: ValueError: max() arg is an empty sequence. It seems that the code fails to recognize any inputs when applying the ss_initial option in the CombinedBlock.impulse_nonlinear function:
To investigate whether this issue is related to changes in ss_terminal, I attempted to use the same code but with the same steady state:
However, the error persists.
I verified this code with the option 'ss_initial' in a model lacking heterogeneity across discount factors and permanent abilities, and it worked flawlessly. To incorporate these factors, I created nb (number of betas) * na (number of abilities) het_blocks, then aggregated them all with respect to their weights (that I know).
What puzzles me is that everything has functioned smoothly thus far for transitory shocks. When I apply the code without the option 'ss_initial', it works fine. The problem only arises when I use this option, which is necessary for the permanent shock.
Do you have an idea where the problem might be?
Thank you
Valter Nóbrega
The text was updated successfully, but these errors were encountered: