% BBCDLmodelcomp_ss_defs

% original variables
c1c = log(c1css);
c1cd = log(c1cdss);
c1mc = log(c1mcss);
c1y = log(c1yss);
c1g = log(c1gss);
c1rpcpd = log(c1rpcpdss);
c1dcore = c1pistar;
c1hp = log(c1hpss);
c1gp = log(c1gpss);
c1pstar = log(1);
c1pid = c1pistar;
c1deltad = 0;
c1rn = c1rnss;

c2c = log(c2css);
c2cd = log(c2cdss);
c2mc = log(c2mcss);
c2y = log(c2yss);
c2g = log(c2gss);
c2rpcpd = log(c2rpcpdss);
c2dcore = c2pistar;
c2hp = log(c2hpss);
c2gp = log(c2gpss);
c2pstar = log(1);
c2pid = c2pistar;
c2deltad = 0;
c2rn = c2rnss;

c1rer = log(c1rerss);
c2rerss = 1/c1rerss;
c2rer = log(c2rerss);
c1shockgy = c1shockgyss;
c1z = c1zss;
c1taupvar = c1taupvarss;
c2shockgy = c2shockgyss;
c2z = c2zss;
c2taupvar = c2taupvarss;

c1pcore = log(1);
c2pcore = log(1);
c1ngdp  = log(c1yss);
c2ngdp  = log(c2yss);
c1dnxf  = log(1);
c2dnxf  = log(1);


Util1 = Util1ss; 
Util2 = Util2ss; 
Welfcon1 = Welfcon1;
Welf1 = Util1/(1-nbeta); 
Welf2 = Util2/(1-nbeta); 
Util = omega_welf1*Util1 + omega_welf2*Util2; 
Welf = Util/(1-nbeta); 
instr1 = c1y;
instr2 = c2y;c1deltadlag =c1deltad; 
c1deltadlag2 =c1deltad; 
c1ngdplag =c1ngdp; 
c1ngdplag2 =c1ngdp; 
c1pcorelag =c1pcore; 
c1pcorelag2 =c1pcore; 
c1rerlag =c1rer; 
c1rerlag2 =c1rer; 
c1rnlag =c1rn; 
c1rnlag2 =c1rn; 
c1rpcpdlag =c1rpcpd; 
c1rpcpdlag2 =c1rpcpd; 
c1ylag =c1y; 
c1ylag2 =c1y; 
c2deltadlag =c2deltad; 
c2deltadlag2 =c2deltad; 
c2ngdplag =c2ngdp; 
c2ngdplag2 =c2ngdp; 
c2pcorelag =c2pcore; 
c2pcorelag2 =c2pcore; 
c2rerlag =c2rer; 
c2rerlag2 =c2rer; 
c2rnlag =c2rn; 
c2rnlag2 =c2rn; 
c2rpcpdlag =c2rpcpd; 
c2rpcpdlag2 =c2rpcpd; 
c2ylag =c2y; 
c2ylag2 =c2y; 

nvars = M_.endo_nbr;
for i_indx = 1:nvars
  varstring = M_.endo_names{i_indx};
  if isempty(strfind(varstring,'mult')) && isempty(strfind(varstring,'AUX')) && isempty(strfind(varstring,'Welfcorrection'))
      eval([varstring,'_ss = ',varstring,';']);
  end
end
BBCDLmodelcomp_ramsey_c1y_c2y_lmss; 
lmult1=lmss_vals(1); 
lmult2=lmss_vals(2); 
lmult3=lmss_vals(3); 
lmult4=lmss_vals(4); 
lmult5=lmss_vals(5); 
lmult6=lmss_vals(6); 
lmult7=lmss_vals(7); 
lmult8=lmss_vals(8); 
lmult9=lmss_vals(9); 
lmult10=lmss_vals(10); 
lmult11=lmss_vals(11); 
lmult12=lmss_vals(12); 
lmult13=lmss_vals(13); 
lmult14=lmss_vals(14); 
lmult15=lmss_vals(15); 
lmult16=lmss_vals(16); 
lmult17=lmss_vals(17); 
lmult18=lmss_vals(18); 
lmult19=lmss_vals(19); 
lmult20=lmss_vals(20); 
lmult21=lmss_vals(21); 
lmult22=lmss_vals(22); 
lmult23=lmss_vals(23); 
lmult24=lmss_vals(24); 
lmult25=lmss_vals(25); 
lmult26=lmss_vals(26); 
lmult27=lmss_vals(27); 
lmult28=lmss_vals(28); 
lmult29=lmss_vals(29); 
lmult30=lmss_vals(30); 
lmult31=lmss_vals(31); 
lmult32=lmss_vals(32); 
lmult33=lmss_vals(33); 
lmult34=lmss_vals(34); 
lmult35=lmss_vals(35); 
lmult36=lmss_vals(36); 
lmult37=lmss_vals(37); 
lmult38=lmss_vals(38); 
lmult39=lmss_vals(39); 
lmult40=lmss_vals(40); 
lmult41=lmss_vals(41); 
lmult42=lmss_vals(42); 
lmult43=lmss_vals(43); 
lmult44=lmss_vals(44); 
lmult45=lmss_vals(45); 
lmult46=lmss_vals(46); 
lmult47=lmss_vals(47); 
lmult48=lmss_vals(48); 
lmult49=lmss_vals(49); 
lmult50=lmss_vals(50); 
lmult51=lmss_vals(51); 
lmult52=lmss_vals(52); 
lmult53=lmss_vals(53); 
lmult54=lmss_vals(54); 
lmult55=lmss_vals(55); 
lmult56=lmss_vals(56); 
lmult57=lmss_vals(57); 
lmult58=lmss_vals(58); 
lmult59=lmss_vals(59); 
lmult60=lmss_vals(60); 
lmult61=lmss_vals(61); 
lmult62=lmss_vals(62); 
lmult63=lmss_vals(63); 
lmult64=lmss_vals(64); 
lmult65=lmss_vals(65); 
Welfcorrection =+lmult31*(Welfcon1_ss - Welfcon1_ss*c1beta + exp(c1c_ss)^(1 - c1sigma)/(c1sigma - 1))+lmult32*(1/(c1rn_ss + 1) - (c1beta*exp(-c1rpcpd_ss)*exp(c1rpcpd_ss)*exp(c1c_ss)^c1sigma)/(c1pid_ss*exp(c1c_ss)^c1sigma))+lmult37*(exp(c1hp_ss) - (c1chi0*exp(c1rpcpd_ss)*exp(c1y_ss)*exp(c1c_ss)^c1sigma*(exp(-c1z_ss)*exp(c1y_ss))^c1chi*(c1nup + 1))/c1nup - (c1beta*c1xip*exp(-c1rpcpd_ss)*exp(c1hp_ss)*exp(c1rpcpd_ss)*exp(c1c_ss)^c1sigma)/(exp(c1c_ss)^c1sigma*(c1pistar/c1pid_ss)^(((c1chi + 1)*(c1nup + 1))/c1nup)))+lmult38*(exp(c1gp_ss) - (exp(c1y_ss)*(c1taup*exp(c1taupvar_ss) + 1))/c1nup - (c1beta*c1xip*exp(-c1rpcpd_ss)*exp(c1gp_ss)*exp(c1rpcpd_ss)*exp(c1c_ss)^c1sigma*(c1pistar/c1pid_ss)^(1 - (c1nup + 1)/c1nup))/exp(c1c_ss)^c1sigma)+lmult46*(1/(c2rn_ss + 1) - (c2beta*exp(-c2rpcpd_ss)*exp(c2rpcpd_ss)*exp(c2c_ss)^c2sigma)/(c2pid_ss*exp(c2c_ss)^c2sigma))+lmult51*(exp(c2hp_ss) - (c2chi0*exp(c2rpcpd_ss)*exp(c2y_ss)*exp(c2c_ss)^c2sigma*(exp(-c2z_ss)*exp(c2y_ss))^c2chi*(c2nup + 1))/c2nup - (c2beta*c2xip*exp(-c2rpcpd_ss)*exp(c2hp_ss)*exp(c2rpcpd_ss)*exp(c2c_ss)^c2sigma)/(exp(c2c_ss)^c2sigma*(c2pistar/c2pid_ss)^(((c2chi + 1)*(c2nup + 1))/c2nup)))+lmult52*(exp(c2gp_ss) - (exp(c2y_ss)*(c2taup*exp(c2taupvar_ss) + 1))/c2nup - (c2beta*c2xip*exp(-c2rpcpd_ss)*exp(c2gp_ss)*exp(c2rpcpd_ss)*exp(c2c_ss)^c2sigma*(c2pistar/c2pid_ss)^(1 - (c2nup + 1)/c2nup))/exp(c2c_ss)^c2sigma); 
