def compute_steady_state_quantities(c, tau):
    """
    Compute the steady state unemployment rate given c and tau using optimal
    quantities from the McCall model and computing corresponding steady state
    quantities

    """
    w_bar, lmda, V, U = compute_optimal_quantities(c, tau)

    # Compute steady state employment and unemployment rates
    lm = LakeModel(alpha=alpha_q, lmda=lmda, b=b, d=d)
    x = lm.rate_steady_state()
    e, u = x

    # Compute steady state welfare
    w = np.sum(V * p_vec *
               (w_vec - tau > w_bar)) / np.sum(p_vec * (w_vec - tau > w_bar))
    welfare = e * w + u * U

    return e, u, welfare
Esempio n. 2
0
"""
Agent dynamics the a lake model.

"""

import numpy as np
import matplotlib.pyplot as plt
from lake_model import LakeModel
from quantecon import MarkovChain
import matplotlib
matplotlib.style.use('ggplot')

lm = LakeModel(d=0, b=0)
T = 5000  # Simulation length

alpha, lmda = lm.alpha, lm.lmda

P = [[1 - lmda, lmda], [alpha, 1 - alpha]]

mc = MarkovChain(P)

xbar = lm.rate_steady_state()

fig, axes = plt.subplots(2, 1, figsize=(10, 8))
s_path = mc.simulate(T, init=1)
s_bar_e = s_path.cumsum() / range(1, T + 1)
s_bar_u = 1 - s_bar_e

ax = axes[0]
ax.plot(s_bar_u, '-b', lw=2, alpha=0.5)
ax.hlines(xbar[1], 0, T, 'r', '--')
Esempio n. 3
0
"""
Stock dynamics the a lake model.
"""

import numpy as np
import matplotlib.pyplot as plt
from lake_model import LakeModel
import matplotlib
matplotlib.style.use('ggplot')

lm = LakeModel()
e_0 = 0.92     # Initial employment rate
u_0 = 1 - e_0  # Initial unemployment rate
T = 50         # Simulation length

xbar = lm.rate_steady_state()

fig, axes = plt.subplots(2, 1, figsize=(10, 8))
x_0 = (e_0, u_0)
x_path = np.vstack(lm.simulate_rate_path(x_0, T))

ax = axes[0]
ax.plot(x_path[:,0], '-b', lw=2, alpha=0.5)
ax.hlines(xbar[0], 0, T, 'r', '--')
ax.set_title(r'Employment rate')

ax = axes[1]
ax.plot(x_path[:,1], '-b', lw=2, alpha=0.5)
ax.hlines(xbar[1], 0, T, 'r', '--')
ax.set_title(r'Unemployment rate')