Skip to content

Commit

Permalink
add func
Browse files Browse the repository at this point in the history
  • Loading branch information
jdebacker committed Mar 14, 2024
1 parent 0ce39d8 commit 2af61cc
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ogcore/SS.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ def inner_loop(outer_loop_vars, p, client):
# L_vec[m_ind] = firm.solve_L(
# Y_vec[m_ind], K_vec[m_ind], K_g, p, "SS", m_ind
# )
# TODO: update how solve for K below, need to use equation 125, probably with a root finder
K_demand_open_vec[m_ind] = firm.get_K(
p.world_int_rate[-1], w_open, L_vec[m_ind], p, "SS", m_ind
)
Expand All @@ -384,6 +385,7 @@ def inner_loop(outer_loop_vars, p, client):
V_open_vec[m_ind] = profit_open / (1 + p.world_int_rate[-1])
# Find output, labor demand, capital demand for industry M
L_M = max(0.001, L - L_vec.sum()) # make sure L_M > 0
# TODO: update how solve for K below, need to use equation 125, probably with a root finder
K_demand_open_vec[-1] = firm.get_K(
p.world_int_rate[-1], w_open, L_M, p, "SS", -1
)
Expand Down
27 changes: 27 additions & 0 deletions ogcore/firm.py
Original file line number Diff line number Diff line change
Expand Up @@ -970,3 +970,30 @@ def solve_K(Y, L, K_g, p, method, m=-1):
) ** (epsilon / (epsilon - 1))

return K


def FOC_K():
"""
The firm's FOC for it's choice of capital stock. Equibrium implies
equivalence between the interest rate and the after tax rate of return
on a unit of investment.
.. math::
r_{t+1} = \frac{(1 - \tau^{corp}_{m,t+1})\left(p_{m,t+1}
(Z_{m,t+1})^\frac{\varepsilon_m-1}{\varepsilon_m}
\left[\gamma_m\frac{\hat{Y}_{m,t+1}}{\hat{K}_{m,t+1}}
\right]^\frac{1}{\varepsilon_m} - \frac{\partial
\Psi(\hat{I}_{m,t+1},\hat{K}_{m,t+1})}{\partial
\hat{K}_{m,t+1}}\right) + 1 - \delta_{m} +
\tau^{corp}_{m,t+1}\delta^\tau_{m,t+1}\left[(1-
\tau^{inv}_{m,t})(1-\delta^\tau_{m,t})-(1-\delta_m)(1-
\tau^{inv}_{m,t+1})\right] - \tau^{inv}_{m,t+1}(1-\delta_{m})}
{(1-\tau^{corp}_{m,t})\frac{\partial
\Psi(\hat{I}_{m,t},\hat{K}_{m,t})}{\partial \hat{K}_{m,t+1}}+1
-\tau^{inv}_{m,t}-\tau^{corp}_{m,t}\delta^{\tau}_{m,t}(1
-\tau^{inv}_{m,t})} - 1 \quad\forall m,t
Args:
Returns:
"""

0 comments on commit 2af61cc

Please sign in to comment.