close all

alpha = 0.5;
beta =.99;
eta = 2;
chi_N = 1;   
chi_M =1; 
nu =1;  
delta = 0.025;
theta = 0.5;
phi = 2;
F_ss = 0.01;
Sigma_ss = 0.28;
Zeta_ss = 0.06;
Rzeta = 1.0092;
epsilon = 11;
gamma =1;
gammae = 0.21;
taue = 0.97;
We = 0.0783;
rho_a = 0.9;
rho_d = 0;
phi_pi = 1.5;
phi_y = 0;
rho_sigma = 0.9;
rho_zeta = 0.9;
sigma_a = 1;% 1 percent (0.01)
sigma_d = 1;
sigma_cb = 1;
sigma_sigma = 1;% 1 percent (0.01)
sigma_zeta = 1;

As = 1;
Qs = 1;
Sigmas = Sigma_ss;
Zetas =Zeta_ss;

Omegabars = exp(norminv(F_ss)*Sigmas-Sigmas^2/2);
G_ss = normcdf((log(Omegabars) + Sigmas^2/2) / Sigmas - Sigmas);
GAMMA_ss = Omegabars*(1-F_ss) + G_ss;
dF_ss = 1/(Omegabars*Sigmas)*normpdf((log(Omegabars) + Sigmas^2/2) / Sigmas);

Rds = 1/beta;
Rcbs = (Rds-Rzeta*Zetas)/(1-Zetas);
lames = (1-F_ss)/(1-F_ss-gammae*Omegabars*dF_ss);
Res = lames*Rcbs/((1-GAMMA_ss)+lames*(GAMMA_ss-gammae*G_ss));
Leverages = 1+lames*(GAMMA_ss-gammae*G_ss)/(1-GAMMA_ss);
RLs = Omegabars*Res*Leverages/(Leverages-1);
rs = Res - (1-delta);

pis = 1;
pistars = 1;
mcs = (epsilon-1)/epsilon;
ws = (1-alpha)*(alpha^alpha*mcs/(rs^alpha))^(1/(1-alpha));
K_Ns=(ws/rs)*(alpha/(1-alpha));
dps = 1;
Y_Ns = (K_Ns)^alpha;
inv_Ns = delta*(K_Ns);
C_Ns = Y_Ns-inv_Ns;
Ns = (ws/chi_N*1/((K_Ns)^alpha-delta*(K_Ns)))^(eta/(phi+eta));
Ks = K_Ns*Ns;
invs = inv_Ns*Ns;
Cs = C_Ns*Ns;
Ys = Y_Ns*Ns;
lamfs = Cs^(-eta);
x1s = lamfs*mcs*Ys/(1-theta*beta);
x2s = lamfs*Ys/(1-theta*beta);
ms = (chi_M/(Cs^(-eta)*(1-beta)))^(1/gamma);

Vs = taue*(1-GAMMA_ss)*Res*Ks +We;

ln_Ys = log(Ys);
ln_Cs = log(Cs);
ln_Is = log(invs);
ln_As = log(As);
ln_Ks = log(Ks);
ln_Ns = log(Ns);
ln_rs = log(rs);
ln_ws = log(ws);
ln_Qs = log(Qs);
ln_Rds = log(Rds);
ln_RLs = log(RLs);
ln_Res= log(Res);
ln_Omegabars= log(Omegabars);
ln_Sigmas= log(Sigmas);
ln_Leverages= log(Leverages);
ln_Vs= log(Vs);
ln_lamfs= log(lamfs);
ln_ms = log(ms);
ln_x1s= log(x1s);
ln_x2s= log(x2s);
ln_dps= log(dps);
ln_pis = log(pis);
ln_pistars= log(pistars);
ln_mcs = log(mcs);
ln_lames = log(lames);
ln_Rcbs = log(Rcbs);
ln_Zetas = log(Zetas);

save Copy5modelcode_indexend1;

