From 2af61cc875315a6ae7af9eff9d5ee61f85e71845 Mon Sep 17 00:00:00 2001 From: jdebacker Date: Thu, 14 Mar 2024 10:56:55 -0400 Subject: [PATCH] add func --- ogcore/SS.py | 2 ++ ogcore/firm.py | 27 +++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/ogcore/SS.py b/ogcore/SS.py index 3dbeb858b..9a64e83b2 100644 --- a/ogcore/SS.py +++ b/ogcore/SS.py @@ -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 ) @@ -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 ) diff --git a/ogcore/firm.py b/ogcore/firm.py index cc750bf3c..821af8e99 100644 --- a/ogcore/firm.py +++ b/ogcore/firm.py @@ -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: + """ \ No newline at end of file