function [ys,params,check] = test_090824_steadystate(ys,exo,M_,options_)% for dynare 4.5.6

 
%% DO NOT CHANGE THIS PART.
%%
%% Here we load the values of the deep parameters in a loop.
%%
NumberOfParameters = M_.param_nbr;
for ii = 1:NumberOfParameters
  paramname = M_.param_names{ii};
  eval([ paramname ' = M_.params(' int2str(ii) ');']);
end
% initialize indicator
check = 0;
%
%%

chii = 1;
qh = 1;
qk = 1;
A = 1;
pie = 1;
epsilonp = epsilonp_ss;
xe = epsilonp/(epsilonp-1);

gammab = gammab_ss;
doverb = 0.89;
r = 0.03/4;
rb = 0.05/4;
betap = 1/(1+r);
betab = (1-gammab)/(1+rb - gammab*(1+r));
boverd = 1/doverb;
psib = exp(etab*(1-gammab*boverd));
cb = (1 - betab*(1+r))/psib;            
d = cb/(rb*boverd - r);                 %budget constraint B
b = d*boverd;

mi = mi_ss;
betai = 0.94;
psii = psib;
lambdai = (psii*(1+rb))/(1-betai*(1+rb));    %foc loans
hi = ((1+rb)*b - log(psii)*(1+rb)*b/etai)/(mi*(1-deltah)); %psi definition
jhi = ((1-betai*(1-deltah))*lambdai - psii*mi*(1-deltah))*(hi^sigmah); %foc housing
li = ((lambdai^(-1/sigmac) + deltah*hi + rb*b)*((1+nui)/(nui*chii)))^(1/(1+nui));  %budget constraint + labour supply + muc 
wi = chii*(li^nui);  
ci = wi*li - deltah*hi - rb*b;
 
Y = wi*li*xe/alphai;
rk = (1-betap*(1-deltak))/betap;
k = alphae*Y/(xe*rk);
kovery = k/(4*Y);
hovery = 2.5;
 
H = hovery*4*Y;
hp = H - hi;
cp = alphap*Y/xe + rk*k + r*d - deltak*k - deltah*hp; %budget constraint
Ik = deltak*k;
Ih = deltah*H;
I = Ih + Ik;
Iovery = I/Y;
 
check = (cp + cb + ci + Ih + Ik)*xe; 
lp = (Y^(1/alphap))*(li^(-alphai/alphap))*(k^(-alphae/alphap)); %production function
wp = alphap*Y/(lp*xe); %labour demand
chip = wp/(lp^nup); %labour supply
lambdap = (cp - chip*(lp^(1+nup))/(1+nup))^(-sigmac);
jhp = (1-betap*(1-deltah))*lambdap/(hp^(-sigmah)); %housing demand

argpsib = d - gammab*b;
argpsii = (1+rb)*b - mi*qh*(1-deltah)*hi;
slopei = psii*(1+rb);
slopeb = psib;
C = cp + cb + ci;

%% THIS BLOCK IS MODEL SPECIFIC.
%%
%% Here the user has to define the steady state.
%%



%% END OF THE MODEL SPECIFIC BLOCK.

%% DO NOT CHANGE THIS PART.
%%
%% Here we define the steady state values of the endogenous variables of
%% the model.
%%
% %%
params=NaN(NumberOfParameters,1);
for iter = 1:length(M_.params) %update parameters set in the file
  eval([ 'params(' num2str(iter) ') = ' M_.param_names{iter} ';' ])
end

NumberOfEndogenousVariables = M_.orig_endo_nbr; %auxiliary variables are set automatically
for ii = 1:NumberOfEndogenousVariables
  varname = M_.endo_names{ii};
  eval(['ys(' int2str(ii) ') = ' varname ';']);
end

                                                           % End of the loop.
%%