Exemple #1
0
def compute_optimal_quantities(c, tau):
    """
    Compute the reservation wage, job finding rate and value functions of the
    workers given c and tau.

    """

    mcm = McCallModel(
        alpha=alpha_q,
        beta=beta,
        gamma=gamma,
        c=c - tau,  # post tax compensation
        sigma=sigma,
        w_vec=w_vec - tau,  # post tax wages
        p_vec=p_vec)

    w_bar, V, U = compute_reservation_wage(mcm, return_values=True)
    lmda = gamma * np.sum(p_vec[w_vec - tau > w_bar])
    return w_bar, lmda, V, U
"""
Plots reservation wage against the discount factor

"""

import numpy as np
import matplotlib.pyplot as plt
from mccall_bellman_iteration import McCallModel, solve_mccall_model
from compute_reservation_wage import compute_reservation_wage


grid_size = 25  
beta_vals = np.linspace(0.8, 0.99, grid_size)  
w_bar_vals = np.empty_like(beta_vals)

mcm = McCallModel()

fig, ax = plt.subplots()

for i, beta in enumerate(beta_vals):
    mcm.beta = beta
    w_bar = compute_reservation_wage(mcm)
    w_bar_vals[i] = w_bar

ax.set_xlabel('discount factor')
ax.set_ylabel('reservation wage')
ax.set_xlim(beta_vals.min(), beta_vals.max())
txt = r'$\bar w$ as a function of $\beta$'
ax.plot(beta_vals, w_bar_vals, 'b-', lw=2, alpha=0.7, label=txt)
ax.legend(loc='upper left')
ax.grid()
"""
Plots reservation wage against the discount factor

"""

import numpy as np
import matplotlib.pyplot as plt
from mccall_bellman_iteration import McCallModel, solve_mccall_model
from compute_reservation_wage import compute_reservation_wage

grid_size = 25
beta_vals = np.linspace(0.8, 0.99, grid_size)
w_bar_vals = np.empty_like(beta_vals)

mcm = McCallModel()

fig, ax = plt.subplots()

for i, beta in enumerate(beta_vals):
    mcm.beta = beta
    w_bar = compute_reservation_wage(mcm)
    w_bar_vals[i] = w_bar

ax.set_xlabel('discount factor')
ax.set_ylabel('reservation wage')
ax.set_xlim(beta_vals.min(), beta_vals.max())
txt = r'$\bar w$ as a function of $\beta$'
ax.plot(beta_vals, w_bar_vals, 'b-', lw=2, alpha=0.7, label=txt)
ax.legend(loc='upper left')
ax.grid()
"""
Generate plots of value of employment and unemployment in the McCall model.

"""

import numpy as np
import matplotlib.pyplot as plt

from mccall_bellman_iteration import McCallModel, solve_mccall_model

mcm = McCallModel()
V, U = solve_mccall_model(mcm)

fig, ax = plt.subplots()

ax.plot(mcm.w_vec, V, 'b-', lw=2, alpha=0.7, label='$V$')
ax.plot(mcm.w_vec, [U] *len(mcm.w_vec) , 'g-', lw=2, alpha=0.7, label='$U$')
ax.legend(loc='upper left')
ax.grid()

plt.show()
Exemple #5
0
"""
Plots reservation wage against unemployment compensation

"""

import numpy as np
import matplotlib.pyplot as plt
from mccall_bellman_iteration import McCallModel, solve_mccall_model
from compute_reservation_wage import compute_reservation_wage

grid_size = 25
c_vals = np.linspace(2, 12, grid_size)  # values of unemployment compensation
w_bar_vals = np.empty_like(c_vals)

mcm = McCallModel()

fig, ax = plt.subplots()

for i, c in enumerate(c_vals):
    mcm.c = c
    w_bar = compute_reservation_wage(mcm)
    w_bar_vals[i] = w_bar

ax.set_xlabel('unemployment compensation')
ax.set_ylabel('reservation wage')
txt = r'$\bar w$ as a function of $c$'
ax.plot(c_vals, w_bar_vals, 'b-', lw=2, alpha=0.7, label=txt)
ax.legend(loc='upper left')
ax.grid()

plt.show()
"""
Plots reservation wage against unemployment compensation

"""

import numpy as np
import matplotlib.pyplot as plt
from mccall_bellman_iteration import McCallModel, solve_mccall_model
from compute_reservation_wage import compute_reservation_wage


grid_size = 25  
c_vals = np.linspace(2, 12, grid_size)  # values of unemployment compensation
w_bar_vals = np.empty_like(c_vals)

mcm = McCallModel()

fig, ax = plt.subplots()

for i, c in enumerate(c_vals):
    mcm.c = c
    w_bar = compute_reservation_wage(mcm)
    w_bar_vals[i] = w_bar

ax.set_xlabel('unemployment compensation')
ax.set_ylabel('reservation wage')
txt = r'$\bar w$ as a function of $c$'
ax.plot(c_vals, w_bar_vals, 'b-', lw=2, alpha=0.7, label=txt)
ax.legend(loc='upper left')
ax.grid()
"""
Plots reservation wage against the job separation rate

"""

import numpy as np
import matplotlib.pyplot as plt
from mccall_bellman_iteration import McCallModel, solve_mccall_model
from compute_reservation_wage import compute_reservation_wage


grid_size = 25  
alpha_vals = np.linspace(0.05, 0.5, grid_size)  
w_bar_vals = np.empty_like(alpha_vals)

mcm = McCallModel()

fig, ax = plt.subplots()

for i, alpha in enumerate(alpha_vals):
    mcm.alpha = alpha
    w_bar = compute_reservation_wage(mcm)
    w_bar_vals[i] = w_bar

ax.set_xlabel('job separation rate')
ax.set_ylabel('reservation wage')
ax.set_xlim(alpha_vals.min(), alpha_vals.max())
txt = r'$\bar w$ as a function of $\alpha$'
ax.plot(alpha_vals, w_bar_vals, 'b-', lw=2, alpha=0.7, label=txt)
ax.legend(loc='upper right')
ax.grid()
Exemple #8
0
"""
Plots reservation wage against the job separation rate

"""

import numpy as np
import matplotlib.pyplot as plt
from mccall_bellman_iteration import McCallModel, solve_mccall_model
from compute_reservation_wage import compute_reservation_wage

grid_size = 25
alpha_vals = np.linspace(0.05, 0.5, grid_size)
w_bar_vals = np.empty_like(alpha_vals)

mcm = McCallModel()

fig, ax = plt.subplots()

for i, alpha in enumerate(alpha_vals):
    mcm.alpha = alpha
    w_bar = compute_reservation_wage(mcm)
    w_bar_vals[i] = w_bar

ax.set_xlabel('job separation rate')
ax.set_ylabel('reservation wage')
ax.set_xlim(alpha_vals.min(), alpha_vals.max())
txt = r'$\bar w$ as a function of $\alpha$'
ax.plot(alpha_vals, w_bar_vals, 'b-', lw=2, alpha=0.7, label=txt)
ax.legend(loc='upper right')
ax.grid()