function [S_ss,Z_ss,ph_ss,pd_ss,Pd_ss,pf_ss, Pf_ss, Pc_ss, pdstar_ss, pi_c_ss, ...
    pi_d_ss, pi_f_ss, bigphi_ss,  R_ss, Rstar_ss, q_ss, mcd_ss, pfstar_ss, ...
    Rh_ss,s_ss, n_ss, K_ss, y_ss, G_ss, H_ss, h_ss, c_ss, I_ss, yf_ss, cd_ss, cf_ss, w_ss, ...
    yx_ss, af_ss, ystar_ss,Id_ss,If_ss, epsilon_n] = SOE_ss(beta)

beta = 0.9889;      % annual (gross) deposit rate = 4.45%
eta = 1;            % elasticity substitution consumption/housing =1 (cobb douglas)
delta = 0.005;      % annual housing depreciation 2% (like Aoki et al.)
mud = 6;            % elasticity of substitution between domestic varieties 
                    % implies markup in domestic sector = 1.2
muf = 6;            % elasticity of substitution between varieties of imported good
                    % markup in import sector = 1.2
alpha = 0.25;       % share of domestic good in consumption
phi = 1;            % elasticity of substitution domestic/foreign goods
bigomega = 0.35;    % share capital in production Elekdag and Tchakarov (2007)
                    % Gertler, Gilchrist & Natalucci set 0.5
alphastar = 0.1;    % percentage domestic goods in foreign consumption (pins down foreign GDP)                    
xi_h = 0.105;      % scaling housing services

S = 1;              % nominal exchange rate normalized to 1
Z = 1;              % Total factor productivity normalized to 1
ph = 1;             % relative price housing services
pd = 1;             % relative price domestic good
Pd = 1;             % price domestically produced good
pf = 1;             % relative price imported good
Pf = 1;             % price importd good
Pc = 1;             % price composite consumption good
Pdstar = 1;         % export price domestic good
pic = 1;            % CPI inflation
pid = 1;            % inflation dimestic good
pif = 1;            % inflation imported good

bigphi = 1;         % steady state value risk premium
R = 1/beta;         % domestic risk free rate
Rstar = 1/beta;     % foreign risk-free rate
q = 1;              % price housing stock
mcd = (mud-1)/mud;  % marginal cost domestic producers
Pf_star = (muf-1)/muf;  % foreign price import good



Rh = R;                         % return to housing investment

s = Rh - (1-delta);                 % fraction housing services

N = 0.33;                           % labor 1/3 total time
K = 3;                              % capital (exogenous)

Yd = (K^bigomega)*(N^(1-bigomega)); % domestic production

G = 0.3*Yd;                         %gov expenditure 30% of gdp

H = (Yd-G)/( (1/xi_h)*s + delta);

h = s*H;                            % housing services

C = (h/xi_h)*ph;                                            % aggregate consumption

I = delta*H;                                                % investment in housing sector

Yf = (1-alpha)*(Pf/Pc)^(-phi)*(C + I);                      % imports

Cd = alpha*(pd)^(-phi)*C;                                   % consumption domestic good

Cf = (1-alpha)*(pf)^(-phi)*C;                               % consumption foreign good

w = mcd*pd*(1-bigomega)*(Yd/N);                             % real wage

epsilon_n = w*(1-N)/C;                                             % adjust xi to match labor supply equation

Yx = Yf;                                                    % exports equal imports in SS

af = 1;

Ystar = alphastar*Yx;

Id = alpha*(pd)^(-phi)*I; 

If = (1-alpha)*(pf)^(-phi)*I;
                                                          
% save steady state values of variables


S_ss = S;
Z_ss = Z;              
ph_ss = ph;
pd_ss = pd;             
Pd_ss = Pd;             
pf_ss = pf;             
Pf_ss = Pf;            
Pc_ss = Pc;             
pdstar_ss = Pdstar;         
pi_c_ss = pic;           
pi_d_ss = pid;            
pi_f_ss = pif;            
bigphi_ss = bigphi;         
R_ss = R;
Rstar_ss = Rstar; 
q_ss = q;              
mcd_ss = mcd; 
pfstar_ss = Pf_star;  
Rh_ss = Rh;                         
s_ss = s;                 
n_ss = N;                           
K_ss = K;                              
y_ss = Yd;
G_ss = G;                        
H_ss = H;
h_ss = h;
c_ss = C;
I_ss = I;
yf_ss = Yf;
cd_ss = Cd;
cf_ss = Cf; 
w_ss = w; 
yx_ss = Yx;
af_ss = af;
ystar_ss = Ystar;
Id_ss = Id;
If_ss = If;
epsilon_n = epsilon_n;