Esempio n. 1
0
EulErr_ss        = [S-1,] vector, steady-state Euler errors
ss_time          = scalar, number of seconds to compute SS solution
rcdiff_ss        = scalar, steady-state difference in goods market
                   clearing (resource constraint)
------------------------------------------------------------------------
'''
# Make initial guess of the steady-state
b_guess = np.zeros(S)
b_guess[:int(round(2 * S / 3))] = (np.linspace(0.003, 0.3,
                                   int(round(2 * S / 3))))
b_guess[int(round(2 * S / 3)):] = (np.linspace(0.3, 0.1,
                                   S - int(round(2 * S / 3))))
# Make sure initial guess is feasible
feas_params = (S, A, alpha, delta, L, chi_b)
GoodGuess, K_constr_init, bsp1_constr_init, c_constr_init = \
    ssf.feasible(feas_params, b_guess, nvec)
if K_constr_init == True and bsp1_constr_init == True:
    print 'Initial guess is not feasible because K<=0 and b_{S+1}<=0. Some element(s) of bvec must increase.'
if K_constr_init == True and bsp1_constr_init == False:
    print 'Initial guess is not feasible because K<=0. Some element(s) of bvec must increase.'
elif (K_constr_init == False and bsp1_constr_init == True and
  c_constr_init.max() == True):
    print 'Initial guess is not feasible because b_{S+1}<=0 and some element of c<=0. Some element(s) of bvec must decrease.'
elif (K_constr_init == False and bsp1_constr_init == False and
  c_constr_init.max() == True):
    print 'Initial guess is not feasible because some element of c<=0. Some element(s) of bvec must increase and some must decrease.'
elif (K_constr_init == False and bsp1_constr_init == True and
  c_constr_init.max() == False):
    print 'Initial guess is not feasible because b_{S+1}<=0. b_{S+1} must increase.'
elif GoodGuess == True:
    print 'Initial guess is feasible.'
Esempio n. 2
0
               clearing (resource constraint) in each industry
------------------------------------------------------------------------
'''

# Make sure initial guess of r and w is feasible
rbar_init = ((1 + 0.04) ** (80 / S)) - 1
wbar_init = 1.
rwbar_init = np.array([rbar_init, wbar_init])
feas_params = (S, alpha, beta, sigma, ss_tol)
b_guess = np.zeros(S-1)
b_guess[:int(round(2 * S / 3))] = \
    (np.linspace(0.003, 0.3, int(round(2 * S / 3))))
b_guess[int(round(2 * S / 3)):] = \
    (np.linspace(0.3, 0.003, S - 1 - int(round(2 * S / 3))))
GoodGuess, r_cstr_ss, w_cstr_ss, c_tilde_cstr_ss, c_cstr_ss, K_cstr_ss \
    = ssf.feasible(feas_params, rwbar_init, b_guess, c_bar, A,
    gamma, epsilon, delta, xi, pi, M, I, S, n)

if r_cstr_ss == True and w_cstr_ss == True:
    print 'Initial guess is not feasible because both r, w <= 0.'
elif r_cstr_ss == True and w_cstr_ss == False:
    print 'Initial guess is not feasible because r <= 0.'
elif r_cstr_ss == False and w_cstr_ss == True:
    print 'Initial guess is not feasible because w <= 0.'
elif (r_cstr_ss == False and w_cstr_ss == False and c_tilde_cstr_ss.max() == 1
  and K_cstr_ss == False):
    print 'Initial guess is not feasible because c_tilde_{s}<=0 for some s.'
elif (r_cstr_ss == False and w_cstr_ss == False and c_tilde_cstr_ss.max() == 1
  and K_cstr_ss == True):
    print 'Initial guess is not feasible because c_tilde_{s}<=0 for some s and sum of K_{m}<=0.'
elif (r_cstr_ss == False and w_cstr_ss == False and c_tilde_cstr_ss.max() == 0
  and c_cstr_ss.max() == 1 and K_cstr_ss == False):
Esempio n. 3
0
EulErr_ss        = [S-1,] vector, steady-state Euler errors
ss_time          = scalar, number of seconds to compute SS solution
rcdiff_ss        = scalar, steady-state difference in goods market
                   clearing (resource constraint)
------------------------------------------------------------------------
'''
# Make initial guess of the steady-state
b_guess = np.zeros(S)
b_guess[:int(round(2 * S / 3))] = (np.linspace(0.003, 0.3,
                                               int(round(2 * S / 3))))
b_guess[int(round(2 * S / 3)):] = (np.linspace(0.3, 0.1,
                                               S - int(round(2 * S / 3))))
# Make sure initial guess is feasible
feas_params = (S, A, alpha, delta, L, chi_b)
GoodGuess, K_constr_init, bsp1_constr_init, c_constr_init = \
    ssf.feasible(feas_params, b_guess, nvec)
if K_constr_init == True and bsp1_constr_init == True:
    print 'Initial guess is not feasible because K<=0 and b_{S+1}<=0. Some element(s) of bvec must increase.'
if K_constr_init == True and bsp1_constr_init == False:
    print 'Initial guess is not feasible because K<=0. Some element(s) of bvec must increase.'
elif (K_constr_init == False and bsp1_constr_init == True
      and c_constr_init.max() == True):
    print 'Initial guess is not feasible because b_{S+1}<=0 and some element of c<=0. Some element(s) of bvec must decrease.'
elif (K_constr_init == False and bsp1_constr_init == False
      and c_constr_init.max() == True):
    print 'Initial guess is not feasible because some element of c<=0. Some element(s) of bvec must increase and some must decrease.'
elif (K_constr_init == False and bsp1_constr_init == True
      and c_constr_init.max() == False):
    print 'Initial guess is not feasible because b_{S+1}<=0. b_{S+1} must increase.'
elif GoodGuess == True:
    print 'Initial guess is feasible.'
Esempio n. 4
0
               clearing (resource constraint) in each industry
------------------------------------------------------------------------
'''

# Make sure initial guess of r and w is feasible
rbar_init = ((1 + 0.04) ** (80 / S)) - 1
wbar_init = 1.
rwbar_init = np.array([rbar_init, wbar_init])
feas_params = (S, alpha, beta, sigma, ss_tol)
b_guess = np.zeros(S-1)
b_guess[:int(round(2 * S / 3))] = \
    (np.linspace(0.003, 0.3, int(round(2 * S / 3))))
b_guess[int(round(2 * S / 3)):] = \
    (np.linspace(0.3, 0.003, S - 1 - int(round(2 * S / 3))))
GoodGuess, r_cstr_ss, w_cstr_ss, c_cstr_ss, cm_cstr_ss, K1K2_cstr_ss \
    = ssf.feasible(feas_params, rwbar_init, b_guess, cmtilvec, Avec,
    gamvec, epsvec, delvec, nvec)

if r_cstr_ss == True and w_cstr_ss == True:
    print 'Initial guess is not feasible because both r + delvec, w <= 0.'
elif r_cstr_ss == True and w_cstr_ss == False:
    print 'Initial guess is not feasible because r + delvec <= 0.'
elif r_cstr_ss == False and w_cstr_ss == True:
    print 'Initial guess is not feasible because w <= 0.'
elif (r_cstr_ss == False and w_cstr_ss == False and c_cstr_ss.max() == 1
  and K1K2_cstr_ss == False):
    print 'Initial guess is not feasible because c_s<=0 for some s.'
elif (r_cstr_ss == False and w_cstr_ss == False and c_cstr_ss.max() == 1
  and K1K2_cstr_ss == True):
    print 'Initial guess is not feasible because c_s<=0 for some s and K1+K2<=0.'
elif (r_cstr_ss == False and w_cstr_ss == False and c_cstr_ss.max() == 0
  and cm_cstr_ss.max() == 1 and K1K2_cstr_ss == False):