Skip to content
This repository has been archived by the owner on Jun 10, 2020. It is now read-only.

Update notation in neoclassical_growth, and pretend we don't know the steady-state #30

Open
2 of 3 tasks
jlperla opened this issue Nov 7, 2017 · 5 comments
Open
2 of 3 tasks

Comments

@jlperla
Copy link
Owner

jlperla commented Nov 7, 2017

I want to update the neoclassical growth model to be as simple as possible and to test removing the dependence on the stationary solution. The task list is:

  • Change all notation to match HJBE_discretization.pdf as much as possible
    • e.g. s -> gamma
    • df to Delta or whatever is the correct match)
    • min(mub,0) instead introduced mu_B_m max(muf,0)introducesmu_F_p`, etc.
  • Add comment pointing to the equation number in the latex file for each line of code involving algebra. If you need to add in more equations (or want to rearrange equations) in that document, then go for it.
  • We want to write the equations of the model pretending that we don't know the steady-state. To do this, we will need to play around with what is currently equation (19) in the notes.
    • First, we need to ensure that all cases of $\mu_F$ and $\mu_B$ signs are properly dealt with in the logic, as I am not sure the code/algebra is correct as stated. In particular, it should be clear what happens if both $\mu_F > 0$ and $\mu_B < 0$ at the same time in (19) as opposed to a footnote. Next, what happens if the drifts are exactly 0?
    • I believe that one way to write it where nothing falls through the cracks is as follows:
      $
      {v_i^n}'={v_{i,F}^n}'\bold{1}{{ \mu{i,F} \geq 0}}+{v_{i,B}^n}\bold{1}{{ \mu{i,B}\leq 0 \text{ and } \mu_{i,F} < 0 }}+{\bar{v}i^n}'\bold{1}{{ \mu_{i,F}<0<\mu_{i,B} }}\label{eq:dv-upwind}
      $
    • See if that changes the solution.
    • Next, lets see what happens if we change the behavior around the steady state to pretend we don't know it. In particular, one thing to try is whether (with a fine enough grid) we can just use $\mu_{i,F}$? In that case it would be something like
      $
      {v_i^n}'={v_{i,F}^n}'\bold{1}{{ \mu{i,F} \geq 0}}+{v_{i,B}^n}\bold{1}{{\mu{i,F} < 0 }}
      $
    • Then check if it also works for taking the average. i.e. something like
      $
      {v_i^n}'={v_{i,F}^n}'\bold{1}{{ \mu{i,F} \geq 0}}+{v_{i,B}^n}\bold{1}{{ \mu{i,B}\leq 0 \text{ and } \mu_{i,F} < 0 }}+{\frac{v_{i,F}^n + v_{i,B}^n}{2}}'\bold{1}{{ \mu{i,F}<0<\mu_{i,B} }}\label{eq:dv-upwind}
      $
    • In all cases, when you check if it "works", you should be seeing if the solution changes much, and (especially) if the correct steady state comes out naturally. Also, play around to see if it converges for different initial guesses on the value function.
    • Leave (commenting out whichever one you aren't using) code for the 3 cases in the file, so we can play with it a bit
@sariwxy
Copy link
Contributor

sariwxy commented Nov 12, 2017

  • Notation has been changed and comments added for equation numbers.
  • All three of the variations are currently resulting in messy graphs with imaginary components. I think this may be due to dV_Upwind taking negative values --> c=dV_Upwind^(-1/gamma) then has a complex component? Not sure if it's design or coincidence that the original equation for dV_Upwind never turns out negative values
  • I have committed a version of the code containing the cases as stated above and am currently trying different variations (labelled 1(a), 2(a), etc.) on those to see if anything works.

@jlperla
Copy link
Owner Author

jlperla commented Nov 12, 2017

Great. I may play around with it as well. If the dV_upwind is taking negative values, then maybe the right approach for the tie breaking rule is to take the max of the two. We can check if it ever takes negative values for both, which seems a little odd since the marginal value should always be positive here.

@jlperla
Copy link
Owner Author

jlperla commented Nov 12, 2017

Looking at the code, it seems a little odd that we are getting negative values. That would mean (11) and (12) have decreasing value in k... Seems like there might be something odd going on during the convergence?

@jlperla jlperla assigned jlperla and unassigned sariwxy Nov 12, 2017
@jlperla
Copy link
Owner Author

jlperla commented Nov 12, 2017

I think I found the issue. You didn't rename dk to $\Delta$, and instead had them as two separate numbers.

I have made the changes and am pushing to the server. It seems to give the same, or close to, the correct answer (except at the top corner). But I am also not convinced that the dV_f logic in the original code was ideal, so it isn't necessarily a mistake in the setup.

If you have made any local changes, I would Discard them by going into the github desktop, right clicking on the file you modifed, and saying "Discard Changes...".

I am taking over the file now, thanks so much! When you have time to work on this again, I would go to #2 so we can try the alternative method of solving this problem. But this can wait a week.

@jlperla
Copy link
Owner Author

jlperla commented Nov 12, 2017

@wangxy373 See latest comment if you didn't get the email.

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

No branches or pull requests

2 participants