Skip to content

Commit f8a9f17

Browse files
authored
Merge pull request #10 from gboehl/andkound98-econpizza-hank-example-mc
Andkound98 econpizza hank example mc
2 parents e580024 + 79a6159 commit f8a9f17

File tree

6 files changed

+13
-9
lines changed

6 files changed

+13
-9
lines changed

econpizza/examples/hank_labor.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ functions_file: 'hank_labor_functions.py'
1010
definitions: |
1111
from jax.numpy import log, maximum
1212
from econpizza.tools import percentile, jax_print
13-
variables: [ div, y, y_prod, w, pi, R, Rn, Rr, Rstar, tax, z, beta, C, N, B, Top10C, Top10A ]
13+
variables: [ div, mc, y, y_prod, w, pi, R, Rn, Rr, Rstar, tax, z, beta, C, N, B, Top10C, Top10A ]
1414
parameters: [ sigma_c, sigma_l, theta, psi, phi_pi, phi_y, rho, rho_beta, rho_r, rho_z, chi ]
1515
shocks: [ e_beta, e_rstar, e_z ]
1616

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

6061
# government
6162
~ Rr = RLag/pi # real rate ex-post
@@ -92,7 +93,8 @@ steady_state:
9293
z: 1. # technology
9394
pi: 1.0 # inflation
9495
B: 5.6 # bond supply
95-
w: (theta-1)/theta # wages
96+
mc: (theta-1)/theta # marginal costs
97+
w: mc*z
9698
div: 1 - w*N # dividends
9799
Rstar: 1.002 # steady stat target rate
98100

econpizza/examples/hank_with_comments.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ definitions: |
1818
from econpizza.tools import percentile, jax_print
1919
2020
# these lists define the relevant models objects
21-
variables: [ div, y, y_prod, w, pi, R, Rn, Rr, Rstar, tax, z, beta, C, n, B, Top10C, Top10A ]
21+
variables: [ div, mc, y, y_prod, w, pi, R, Rn, Rr, Rstar, tax, z, beta, C, n, B, Top10C, Top10A ]
2222
parameters: [ sigma_c, sigma_l, theta, psi, phi_pi, phi_y, rho, rho_beta, rho_r, rho_z ]
2323
shocks: [ e_beta, e_rstar, e_z ]
2424

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

9495
# government
9596
~ tax = (Rr-1)*BLag # balanced budget
@@ -129,10 +130,11 @@ steady_state:
129130
beta: 0.98 # discount factor
130131
B: 5.6 # bond supply
131132
# definitions can be recursive: theta is defined above
132-
w: (theta-1)/theta # wages
133+
mc: (theta-1)/theta # marginal costs
134+
w: (mc*y)**(sigma_l/(1+sigma_l)) # wages
133135
n: w**(1/sigma_l) # labor supply
134-
div: 1 - w*n # dividends
135136
z: y/n # technology
137+
div: 1 - w*n # dividends
136138

137139
init_guesses:
138140
Rstar: 1.002 # steady state target rage
408 Bytes
Binary file not shown.
168 Bytes
Binary file not shown.

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# ubuntu seems to have issues with jax v0.4.6. Recheck when v0.4.7 is out
22
jax>=0.4.13
33
jaxlib>=0.4.13
4-
grgrjax>=0.4.3
4+
grgrjax>=0.4.4
55
scipy
66
pyyaml
77
pytest

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
install_requires=[
3737
"jax>=0.4.13",
3838
"jaxlib>=0.4.13",
39-
"grgrjax>=0.4.3",
39+
"grgrjax>=0.4.4",
4040
"pyyaml",
4141
"scipy",
4242
],

0 commit comments

Comments
 (0)