clear all
close all

eta = 0.8;
beta = 0.99;
delta = 0.025;
b = 0.65;
sigma = 2;
tau = 2;
phi = 1;


phiw =0.75;
phip=0.75;
phipi = 1.5;
phiy = 0.125;
upsilons =1;
chi1 = (1/beta - (1-delta))/upsilons;
chi2 = 0.01;

rhog = 0.9;
rhoalphak =0.9;
rhoalphal =0.9;
rhomw =0.9;
rhomp =0.9;
rhoi =0.9;
rhoupsilon =0.9;
sdg =0.01;
sdalphak =0.01;
sdalphal =0.01;
sdmw =0.01;
sdmp =0.01;
sdi =0.01;
sdupsilon =0.01;



vps = 1;
us  =1;
pss  =0.1;
Als=1;
lss  =(1-pss)*2/3;
kss  =1-pss-lss;
tss  =1;
pis = 1; %zeros inflation steady state
pistars =1;
is = pis/beta; %nominal interest rate



%xs means the steady state value of x;
Rks= (1/beta - (1-delta))/upsilons; %capital rate

alphals= lss/(1-pss);
alphaks= kss/(1-pss);
mps=1/(1-pss);
Aks=Rks*(mps/alphaks)^(eta/(eta-1))*kss^(1/(eta-1));
Ls=1/3;
Ys=(alphals/mps/lss)^(eta/(eta-1))*Als*Ls;
ws=lss*Ys/Ls;
Ks=kss*Ys/Rks;

mcs= 1/mps;
invs=delta*Ks;
xs = invs/upsilons;
Cs = Ys - xs;
Kbars = Ks;
c1 = (1-beta*b)/(1-b)^sigma; %simplifying parameter
lams = c1/Cs^sigma;
mus = lams/upsilons;
qs = mus/lams;
wstars = ws;
mws=wstars*lams/Ls^phi;
x1s = lams*mcs*Ys/(1-phip*beta);
x2s = lams*Ys/(1-phip*beta);
h1s = Ls^(1+phi)/(1-phiw*beta);
h2s = lams*Ls/(1-phiw*beta);
epsilonws = mws/(mws-1);
epsilonps = mps/(mps-1);
Prs = pss*Ys;

%save all the variables into mat file and then load in mod file
save mediumdsge;

%run the dynare mod file or the compiled mod m file
dynare mediumdsge