Skip to content

Commit

Permalink
Merge pull request #10 from gboehl/andkound98-econpizza-hank-example-mc
Browse files Browse the repository at this point in the history
Andkound98 econpizza hank example mc
  • Loading branch information
gboehl authored Jun 27, 2023
2 parents e580024 + 79a6159 commit f8a9f17
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 9 deletions.
8 changes: 5 additions & 3 deletions econpizza/examples/hank_labor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ functions_file: 'hank_labor_functions.py'
definitions: |
from jax.numpy import log, maximum
from econpizza.tools import percentile, jax_print
variables: [ div, y, y_prod, w, pi, R, Rn, Rr, Rstar, tax, z, beta, C, N, B, Top10C, Top10A ]
variables: [ div, mc, y, y_prod, w, pi, R, Rn, Rr, Rstar, tax, z, beta, C, N, B, Top10C, Top10A ]
parameters: [ sigma_c, sigma_l, theta, psi, phi_pi, phi_y, rho, rho_beta, rho_r, rho_z, chi ]
shocks: [ e_beta, e_rstar, e_z ]

Expand Down Expand Up @@ -55,7 +55,8 @@ equations:
~ N = y_prod/z # production function
~ div = - w*N + (1 - psi*(pi/piSS - 1)**2/2)*y_prod # dividends
~ y = (1 - psi*(pi/piSS - 1)**2/2)*y_prod # "effective" output
~ psi*(pi/piSS - 1)*pi/piSS = (1-theta) + theta*w/z + psi*piPrime/R*(piPrime/piSS - 1)*piPrime/piSS*y_prodPrime/y_prod # NKPC
~ psi*(pi/piSS - 1)*pi/piSS = (1-theta) + theta*mc + psi*piPrime/R*(piPrime/piSS - 1)*piPrime/piSS*y_prodPrime/y_prod # NKPC
~ mc = w/z # marginal costs

# government
~ Rr = RLag/pi # real rate ex-post
Expand Down Expand Up @@ -92,7 +93,8 @@ steady_state:
z: 1. # technology
pi: 1.0 # inflation
B: 5.6 # bond supply
w: (theta-1)/theta # wages
mc: (theta-1)/theta # marginal costs
w: mc*z
div: 1 - w*N # dividends
Rstar: 1.002 # steady stat target rate

Expand Down
10 changes: 6 additions & 4 deletions econpizza/examples/hank_with_comments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ definitions: |
from econpizza.tools import percentile, jax_print
# these lists define the relevant models objects
variables: [ div, y, y_prod, w, pi, R, Rn, Rr, Rstar, tax, z, beta, C, n, B, Top10C, Top10A ]
variables: [ div, mc, y, y_prod, w, pi, R, Rn, Rr, Rstar, tax, z, beta, C, n, B, Top10C, Top10A ]
parameters: [ sigma_c, sigma_l, theta, psi, phi_pi, phi_y, rho, rho_beta, rho_r, rho_z ]
shocks: [ e_beta, e_rstar, e_z ]

Expand Down Expand Up @@ -89,7 +89,8 @@ equations:
~ n = y_prod/z # production function
~ div = -w*n + (1 - psi*(pi/piSS - 1)**2/2)*y_prod # dividends
~ y = (1 - psi*(pi/piSS - 1)**2/2)*y_prod # "effective" output
~ psi*(pi/piSS - 1)*pi/piSS = (1-theta) + theta*w + psi*piPrime/R*(piPrime/piSS - 1)*piPrime/piSS*y_prodPrime/y_prod # NKPC
~ psi*(pi/piSS - 1)*pi/piSS = (1-theta) + theta*mc + psi*piPrime/R*(piPrime/piSS - 1)*piPrime/piSS*y_prodPrime/y_prod # NKPC
~ mc = w/z # marginal costs

# government
~ tax = (Rr-1)*BLag # balanced budget
Expand Down Expand Up @@ -129,10 +130,11 @@ steady_state:
beta: 0.98 # discount factor
B: 5.6 # bond supply
# definitions can be recursive: theta is defined above
w: (theta-1)/theta # wages
mc: (theta-1)/theta # marginal costs
w: (mc*y)**(sigma_l/(1+sigma_l)) # wages
n: w**(1/sigma_l) # labor supply
div: 1 - w*n # dividends
z: y/n # technology
div: 1 - w*n # dividends

init_guesses:
Rstar: 1.002 # steady state target rage
Expand Down
Binary file modified econpizza/testing/cache/hank_labor.npy
Binary file not shown.
Binary file modified econpizza/testing/cache/hank_solid.npy
Binary file not shown.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# ubuntu seems to have issues with jax v0.4.6. Recheck when v0.4.7 is out
jax>=0.4.13
jaxlib>=0.4.13
grgrjax>=0.4.3
grgrjax>=0.4.4
scipy
pyyaml
pytest
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
install_requires=[
"jax>=0.4.13",
"jaxlib>=0.4.13",
"grgrjax>=0.4.3",
"grgrjax>=0.4.4",
"pyyaml",
"scipy",
],
Expand Down

0 comments on commit f8a9f17

Please sign in to comment.