Firm Functions

Contents

Firm Functions

firm.py modules

ogcore.firm

ogcore.firm.get_K(r, w, L, p, method)[source]

Get K from r, w, L. For determining capital demand for open economy case.

\[K_{t} = \frac{K_{t}}{L_{t}} \times L_{t}\]
Parameters
  • r (array_like) – the real interest rate

  • w (array_like) – the wage rate

  • L (array_like) – aggregate labor

  • p (OG-Core Specifications object) – model parameters

  • method (str) – adjusts calculation dimensions based on ‘SS’ or ‘TPI’

Returns

aggregate capital demand

Return type

K (array_like)

ogcore.firm.get_KLratio(r, w, p, method)[source]

This function solves for the capital-labor ratio given the interest rate r wage w and parameters.

\[\frac{K}{L} = \left(\frac{\gamma}{1 - \gamma - \gamma_g}\right) \left(\frac{w_t}{\frac{r_t + \delta - \tau_t^{corp}\delta_t^{\tau}}{1 - \tau_t^{corp}}}\right)^\varepsilon\]
Parameters
  • r (array_like) – the real interest rate

  • w (array_like) – the wage rate

  • p (OG-Core Specifications object) – model parameters

  • method (str) – adjusts calculation dimensions based on ‘SS’ or ‘TPI’

Returns

the capital-labor ratio

Return type

KLratio (array_like)

ogcore.firm.get_K_from_Y(Y, r, p, method)[source]

Generates vector of aggregate capital. Use with the open economy options.

\[\begin{split}K_{t} = \frac{Y_{t}}{Y_{t}/K_{t}} \\ K_{t} = \frac{\gamma Z_t^{\varepsilon -1} Y_t}{ \left(\frac{r_t + \delta - \tau_t^{corp}\delta_t^\tau} {1 - \tau_{t}^{corp}}\right)^\varepsilon}\end{split}\]
Parameters
  • Y (array_like) – aggregate output

  • r (array_like) – the real interest rate

  • p (OG-Core Specifications object) – model parameters

  • method (str) – adjusts calculation dimensions based on ‘SS’ or ‘TPI’

Returns

the real interest rate

Return type

r (array_like)

ogcore.firm.get_K_from_Y_and_L(Y, L, K_g, p, method)[source]

Find aggregate private capital K from output Y, aggregate labor L, and public capital K_g

\[K_{t} = \left(\frac{\left(\frac{Y_t}{Z_t}\right)^{\frac{\varepsilon-1} {\varepsilon}} - (1-\gamma-\gamma_g)L_t^{\frac{\varepsilon-1}{\varepsilon}} - \gamma_g^{\frac{1}{\varepsilon}}K_{g,t}^{\frac{\varepsilon-1}{\varepsilon}}} {\gamma^{\frac{1}{\varepsilon}}}\right)^{\frac{\varepsilon}{\varepsilon-1}}\]
Parameters
  • w (array_like) – the wage rate

  • Y (array_like) – aggregate output

  • L (array_like) – aggregate labor

  • K_g (array_like) – aggregate public capital

  • p (OG-Core Specifications object) – model parameters

  • method (str) – adjusts calculation dimensions based on ‘SS’ or ‘TPI’

Returns

firm capital demand

Return type

K (array_like)

ogcore.firm.get_L_from_Y(w, Y, p, method)[source]

Find aggregate labor L from output Y and wages w

\[L_{t} = \frac{(1 - \gamma - \gamma_g) Z_{t}^{\varepsilon-1} Y_{t}}{w_{t}^{\varepsilon}}\]
Parameters
  • w (array_like) – the wage rate

  • Y (array_like) – aggregate output

  • p (OG-Core Specifications object) – model parameters

  • method (str) – adjusts calculation dimensions based on ‘SS’ or ‘TPI’

Returns

firm labor demand

Return type

L (array_like)

ogcore.firm.get_MPx(Y, x, share, p, method)[source]

Compute the marginal product of x (where x is K, L, or K_g)

\[MPx = Z_t^\frac{\varepsilon-1}{\varepsilon}\left[(share) \frac{\hat{Y}_t}{\hat{x}_t}\right]^\frac{1}{\varepsilon}\]
Parameters
  • Y (array_like) – output

  • x (array_like) – input to production function

  • share (scalar) – share of output paid to factor x

  • p (OG-Core Specifications object) – model parameters

  • method (str) – adjusts calculation dimensions based on ‘SS’ or ‘TPI’

Returns

the marginal product of x

Return type

MPx (array_like)

ogcore.firm.get_Y(K, K_g, L, p, method)[source]

Generates aggregate output (GDP) from aggregate capital stock, aggregate labor, and CES production function parameters.

\[\begin{split}\hat{Y}_t &= F(\hat{K}_t, \hat{K}_{g,t}, \hat{L}_t) \\ &\equiv Z_t\biggl[(\gamma)^\frac{1}{\varepsilon}(\hat{K}_t)^\frac{\varepsilon-1}{\varepsilon} + (\gamma_{g})^\frac{1}{\varepsilon}(\hat{K}_{g,t})^\frac{\varepsilon-1}{\varepsilon} + (1-\gamma-\gamma_{g})^\frac{1}{\varepsilon}(\hat{L}_t)^\frac{\varepsilon-1}{\varepsilon}\biggr]^\frac{\varepsilon}{\varepsilon-1} \quad\forall t\end{split}\]
Parameters
  • K (array_like) – aggregate private capital

  • K_g (array_like) – aggregate government capital

  • L (array_like) – aggregate labor

  • p (OG-Core Specifications object) – model parameters

  • method (str) – adjusts calculation dimensions based on ‘SS’ or ‘TPI’

Returns

aggregate output

Return type

Y (array_like)

ogcore.firm.get_r(Y, K, p, method)[source]

This function computes the interest rate as a function of Y, K, and parameters using the firm’s first order condition for capital demand.

\[r_{t} = (1 - \tau^{corp}_t)Z_t^\frac{\varepsilon-1}{\varepsilon} \left[\gamma\frac{Y_t}{K_t}\right]^\frac{1}{\varepsilon} - \delta + \tau^{corp}_t\delta^\tau_t\]
Parameters
  • Y (array_like) – aggregate output

  • K (array_like) – aggregate capital

  • p (OG-Core Specifications object) – model parameters

  • method (str) – adjusts calculation dimensions based on ‘SS’ or ‘TPI’

Returns

the real interest rate

Return type

r (array_like)

ogcore.firm.get_w(Y, L, p, method)[source]

This function computes the wage as a function of Y, L, and parameters using the firm’s first order condition for labor demand.

\[w_t = Z_t^\frac{\varepsilon-1}{\varepsilon}\left[(1-\gamma-\gamma_g) \frac{\hat{Y}_t}{\hat{L}_t}\right]^\frac{1}{\varepsilon}\]
Parameters
  • Y (array_like) – aggregate output

  • L (array_like) – aggregate labor

  • p (OG-Core Specifications object) – model parameters

  • method (str) – adjusts calculation dimensions based on ‘SS’ or ‘TPI’

Returns

the real wage rate

Return type

w (array_like)

ogcore.firm.get_w_from_r(r, p, method)[source]

Solve for a wage rate from a given interest rate. N.B. this is only appropriate if the production function only uses capital and labor as inputs. As such, this is not used for determining the domestic wage rate due to the presense of public capital in the production function. It is used only to determine the wage rate that affects the open economy demand for capital.

\[w = (1-\gamma)^\frac{1}{\varepsilon}Z\left[(\gamma)^\frac{1} {\varepsilon}\left(\frac{(1-\gamma)^\frac{1}{\varepsilon}} {\left[\frac{r + \delta - \tau^{corp}\delta^\tau}{(1 - \tau^{corp}) \gamma^\frac{1}{\varepsilon}Z}\right]^{\varepsilon-1} - \gamma^\frac{1}{\varepsilon}}\right) + (1-\gamma)^\frac{1}{\varepsilon}\right]^\frac{1}{\varepsilon-1}\]
Parameters
  • r (array_like) – the real interest rate

  • p (OG-Core Specifications object) – model parameters

  • method (str) – adjusts calculation dimensions based on ‘SS’ or ‘TPI’

Returns

the real wage rate

Return type

w (array_like)