function [ys,check] = FinIntGov_steadystate(ys,exe)
global M_

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% dis_lab, chi and lambda_ss are no longer parameters but defined within
% the "model-section" through #dis_lab = ..., #chi = ..., #lambda_ss = ...
alpha       = M_.params(1);
beta        = M_.params(2);
gamma       = M_.params(3);
% delta       = M_.params(4);
sigma_c     = M_.params(4);
upsilon     = M_.params(5);
varphi      = M_.params(6);
psi_p       = M_.params(7);
psi_w       = M_.params(8);
epsilon_p   = M_.params(9);
epsilon_w   = M_.params(10);
gamma_p     = M_.params(11);
gamma_w     = M_.params(12);
theta       = M_.params(13);
lambda_b_k  = M_.params(14);
rho         = M_.params(15);
r_c         = M_.params(16);
vartheta_cf = M_.params(17);
vartheta_p  = M_.params(18);
alpha_b     = M_.params(19);
beta_b      = M_.params(20);
% tau_k       = M_.params(21);
% tau_b       = M_.params(22);
Lambda_x    = M_.params(21);
check       = 0;

load parametervalues;

i_y_ss              = par.i_y;          % steady state ratio of investment over output
g_y_ss              = par.g_y;          % steady state ratio of government spending over output
qb_y_ss             = par.qb_y;         % steady state ratio of government liabilities (q_t^b*b_t) over quarterly output
qb_max_y_ss         = par.qb_max_y;     % steady state level of maximum government liabilities (q_t^b*b_t^max) over quarterly output
Gamma               = par.Gamma;        % steady state spread between loans/bonds and deposits
h                   = par.h_ss;         % steady state value of labor
pi                  = par.pi_ss;        % steady state value for the inflation rate (2 percent annual inflation)
q_k                 = par.q_k_ss;       % steady state value of capital price
z                   = par.z_ss;         % steady state value of productivity
ksi                 = par.ksi_ss;       % steady state value of capital quality variable
c_shock             = par.c_shock_ss;   % steady state value of consumption preference shock
h_shock             = par.h_shock_ss;   % steady state value of labor preference shock
i_shock             = par.i_shock_ss;   % steady state value of investment adjustment costs shock
% x                   = par.x_ss;         % steady state growth of assets
phi                 = par.phi_ss;       % steady state leverage ratio
% r_c                 = par.r_c;          % coupon payment in real terms on government consols
quarters            = par.quarters;     % effective maturity of long-term government bonds
nu_k                = par.nu_k_ss;      % steady state value shadow value loans
nu_b                = par.nu_b_ss;      % steady state value shadow value bonds
eta                 = par.eta_ss;       % steady state value shadow value deposits
phi                 = par.phi_ss;       % steady state leverage ratio
mu                  = par.mu_ss;        % steady state shadow value incentive compatibility constraint bank creditors
n                   = par.n_ss;         % steady state value of net worth
d                   = par.d_ss;         % steady state value of deposits
n_g                 = par.n_g_ss;       % steady state value of government assistance to financial sector
n_g_til             = par.n_g_til_ss;   % steady state value of payback of financial assistance from financial sector to government
aa                  = par.aa_ss;        % steady state value of coefficient relating government support and previous period net worth of individual intermediaries
bb                  = par.bb_ss;        % steady state value of tax rate on previous period net worth
p_def               = 0;                % steady state default probability
lambda_k            = par.lambda_k_ss;  % steady state value diversion rate loans
lambda_b            = par.lambda_b_ss;  % steady state value diversion rate bonds


% Financial steady state values and parameters

mu_x                        = exp(Lambda_x);                    % steady state trend growth
r_d                         = 1/(beta*mu_x^(-sigma_c))-1;       % steady state value for the net return on the deposits
R_d                         = 1+r_d;                            % steady state value for the gross return on the deposits
pi_adj                      = pi^(gamma_p);                     % steady state value inflation indexation
pi_star                     = ((1-psi_p*(pi/pi_adj)^(epsilon_p-1))/(1-psi_p))^(1/(1-epsilon_p));                    % steady state value for the inflation rate of newly chosen prices
r_n                         = (1+r_d)*pi-1;                     % steady state value for the net nominal interest rate
R_n                         = 1+r_n;                            % steady state value for the gross nominal interest rate
Delta                       = (1-psi_p)*pi_star^(-epsilon_p)/(1-psi_p*(pi/pi_adj)^(epsilon_p));                     % steady state value of Delta
r_k                         = r_d+Gamma;                        % steady state value of net return on loans
R_k                         = 1+r_k;                            % steady state value of gross return on loans
Erk                         = r_k;                              % steady state value of expected interest rate on loans
Ecs                         = Gamma;                            % steady state value of expected credit rate spread
tau_k                       = 1-1/(beta*(1+r_k)*mu_x^(-sigma_c)); % tax rate on gross return on capital
x                           = mu_x;                             % steady state growth of assets
x_k                         = x;                                % steady state growth of private loans
x_b                         = x;                                % steady state growth of government bonds

omega                       = mu_x*pi;                          % steady state value for the wage-inflation rate (2 percent annual wage-inflation)
omega_adj                   = omega^(gamma_w);                  % steady state wage-indexation
omega_new                   = ((1-psi_w*(omega/omega_adj)^(epsilon_w-1))/(1-psi_w))^(1/(1-epsilon_w));              % steady state value for the wage-inflation rate
Delta_w                     = ((1-psi_w)*omega_new^(-epsilon_w)/(1-psi_w*(omega/omega_adj)^(epsilon_w)));           % steady state wage-dispersion


% Production steady state values and parameters
m                           = ((1-beta*psi_p*mu_x^(1-sigma_c)*(pi/pi_adj)^(epsilon_p))/(1-beta*psi_p*mu_x^(1-sigma_c)*(pi/pi_adj)^(epsilon_p-1)))*((epsilon_p-1)/epsilon_p)*pi_star;      % steady state value of relative price of intermediate goods with respect to general price level
delta                       = ((1+r_k-ksi)*q_k*i_y_ss-alpha*m*Delta*(mu_x-1))/(alpha*m*Delta-ksi*q_k*i_y_ss);       % calibrated value of depreciation rate
w                           = (alpha^(alpha)*(1-alpha)^(1-alpha)*m/(r_k+delta)^(alpha))^(1/(1-alpha));              % steady state value of wage rate
kh_ss                       = mu_x*(alpha/(1-alpha))*w/(r_k+delta);                                                 % steady state value of capital-labor ratio

k                           = kh_ss*h;                                                                              % steady state value of capital
y                           = z*mu_x^(-alpha)*(ksi*k)^(alpha)*h^(1-alpha)/Delta;                                    % steady state value of output
i                           = (1-(1-delta)/mu_x)*k;                                                                 % steady state value of investment
g                           = g_y_ss*y;                                                                             % steady state value of government spending
g_til                       = g;                                                                                    % steady state value of regular government spending
c                           = y-i-g;                                                                                % steady state value of consumption
lambda                      = (1-beta*upsilon*mu_x^(-sigma_c))*((1-upsilon/mu_x)*c)^(-sigma_c);                     % steady state value of marginal utility of consumption
Ksi_1                       = m*lambda*y/(1-beta*psi_p*mu_x^(1-sigma_c)*(pi/pi_adj)^(epsilon_p));                   % steady state value of Ksi_1
Ksi_2                       = lambda*y/(1-beta*psi_p*mu_x^(1-sigma_c)*(pi/pi_adj)^(epsilon_p-1));                   % steady state value of Ksi_2
Ksi_1_w                     = h^(1+varphi)/(1-beta*psi_w*(omega/omega_adj)^(epsilon_w*(1+varphi)));                 % steady state value of Ksi_1_w
Ksi_2_w                     = lambda*w*h/(1-beta*psi_w*(omega/omega_adj)^(epsilon_w-1));                            % steady state value of Ksi_2_w
dis_lab                     = ((epsilon_w-1)/epsilon_w)*omega_new^(1+epsilon_w*varphi)*Ksi_2_w/Ksi_1_w;             % disutility of labor constant
welf                        = 1;                                                                                    % steady state value of welfare

% sovereign debt variables
qb                          = qb_y_ss*y;                                        % steady state level of government liabilities (q_t^b*b_t)
qb_max                      = qb_max_y_ss*y;                                    % steady state level of maximum government liabilities (q_t^b*b_t^max)


% rho                         = 1/quarters;                                       % maturity structure parameter. Expected life of debt is equal to 1/par.rho
q_b                         = r_c/((1+r_d+lambda_b_k*(r_k-r_d))*pi-(1-rho));      % steady state bond price
r_b                         = (r_c+(1-rho)*q_b)/(pi*q_b)-1;                     % steady state net return on government consols before default
R_b                         = 1+r_b;                                            % steady state gross return on government consols before default
R_nb                        = R_b*pi;                                           % steady state gross nominal return on government consols before default
Erb                         = r_b;                                              % steady state expected return on government consols before default
tau_b                       = 1-1/(beta*(1+r_b)*mu_x^(-sigma_c));               % tax rate on gross return on govt bonds
tau                         = g+((1+r_b)/mu_x-1)*qb+n_g-n_g_til-tau_k*(1+r_k)*q_k*k/mu_x-tau_b*(1+r_b)*qb/mu_x;     % steady state level of lump sum taxes
b                           = qb/q_b;                                           % steady state number of government bonds
b_max                       = qb_max/q_b;                                       % steady state maximum number of government bonds


% Financial variables continued
s_k                         = k;                                                % steady state value of loans to production sector
s_b                         = b;                                                % steady state value of loans to government
p                           = q_k*s_k+q_b*s_b;                                  % steady state value of the assets of the financial intermediaries                                     
weight                      = (q_k*s_k)/p;                                      % steady state value of share of assets invested in loans to production sector
r_p                         = (1+r_k)*weight+(1+r_b)*(1-weight)-1;              % steady state value of interest rate on portfolio
Erp                         = r_p;                                              % steady state value of expected portfolio return


y_obs                       = mu_x;
c_obs                       = mu_x;
i_obs                       = mu_x;
g_obs                       = mu_x;
pi_obs                      = 0;
w_obs                       = mu_x;
h_obs                       = 0;
R_n_obs                     = 0;
R_nb_obs                    = 0;


loglin = 2;

if (loglin == 1)
ys      = [c; lambda; h; welf;...
            nu_k; nu_b; eta; phi; mu; n; s_k; s_b; p; d; weight; x; x_k; x_b;... 
            q_k; q_b; r_k; r_b; r_d; r_p; Erk; Erb; Ecs; Erp;...
            w; m; pi; pi_star; pi_adj; Ksi_1; Ksi_2; Delta;...
            omega; omega_new; omega_adj; Ksi_1_w; Ksi_2_w; Delta_w;...
            i; k; y;...
            b; g; g_til; n_g; n_g_til; tau; aa; bb;...
            r_n;...
            p_def; b_max;...  
            z; ksi; lambda_k; lambda_b;...
            c_shock; h_shock; i_shock; epsilon_p; epsilon_w;...
            R_k; R_b; R_d; R_n; R_nb;...
            mu_x;...
            y_obs; c_obs; g_obs; w_obs; h_obs; pi_obs; R_n_obs];  
else
ys      = [log(c); log(lambda); log(h); welf;...
            log(nu_k); log(nu_b); log(eta); log(phi); log(mu); log(n); log(s_k); log(s_b); log(p); log(d); log(weight); x; x_k; x_b;... 
            log(q_k); log(q_b); r_k; r_b; r_d; r_p; Erk; Erb; Ecs; Erp;...
            log(w); log(m); log(pi); log(pi_star); log(pi_adj); log(Ksi_1); log(Ksi_2); log(Delta);...
            log(omega); log(omega_new); log(omega_adj); log(Ksi_1_w); log(Ksi_2_w); log(Delta_w);...
            log(i); log(k); log(y);...
            log(b); log(g); log(g_til); n_g; n_g_til; log(tau); aa; bb;...
            r_n;...
%             log(r_n);...
            p_def; log(b_max);...  
            z; ksi; log(lambda_k); log(lambda_b);...
            c_shock; h_shock; i_shock; epsilon_p; epsilon_w;...
            log(R_k); log(R_b); log(R_d); log(R_n); log(R_nb);...
            log(mu_x);...
%             y_obs; c_obs; g_obs; w_obs; h_obs; pi_obs; R_n_obs];  
            y_obs; c_obs; g_obs; pi_obs; R_n_obs];  
end

end