%load param_GH.m

Rb=1.0126;
A1=(1-(1-betae*Rb)*thetaess)/(betae*alfe*phie);
A2=betae*A1*alfe*(1-phie)/(1-betae*(1-dltk)-thetaess*(1-betae*Rb));

B1=(1-betae*(1-dltl)-(1-betae*Rb)*thetarss)*Xss/(betae*alfr*phir*dltl);
Yh=B1;
B2=betae*Yh*alfr*(1-phir)/Xss/(1-betae*(1-dltk)-(1-betae*Rb)*thetarss);
Kr=B2;

Le=1;
Lr=1;
Lrs=Lr/dltl;

B3=(1-(1-dlth)*beta)/posiss/dlth;
B4=(1-alfr)*B1/(1-alfe)/A1/Xss;
Nr=(Yh/(Lrs^phir*Kr^(1-phir))^alfr)^(1/(1-alfr));

aa1=(1-alfr)^2*Yh^2*(B3*A1/Xss)^2;
bb1=-chi^2*Nr^3/B4;
cc1=-chi^2*Nr^2;
qle=(-bb1+(bb1^2-4*aa1*cc1)^(1/2))/(2*aa1);
Ne=qle*Nr/B4;

N=Ne+Nr;


Ke=A2*qle;
peYe=A1*qle;
Ye=(Le^phie*Ke^(1-phie))^alfe*Ne^(1-alfe);
pe=peYe/Ye;
w=(1-alfe)*peYe/Ne;
%lam=(1-(1-dlth)*beta)*peYe/posiss/dlth;
lam=posiss/pe/Ye*dlth/((1-(1-dlth)*beta));
C=lam^(-1/sigma);
chi=lam*w/N^phi;
Ie=dltk*Ke;
Ir=dltk*Kr;

qlr=1;
Be=thetaess*(qle*Le+Ke);
Br=thetarss*(qlr*Lrs+Kr);
Ce=alfe*peYe-qle-Ie+(1-Rb)*Be;
Cr=alfr*Yh/Xss-1-Ir+(1-Rb)*Br;

EXY=0.35;
Y=(C+Ce+Cr+Ie+Ir)/(1-EXY);
IM=(Y/(Yh/(1-alfm))^(1-alfm))^(1/alfm)*alfm;
taok=0;
e=1;
Pf=e;
Ph=(Yh/((1-alfm)*Y))^(-1/alfm);
P=Ph^(1-alfm)*Pf^alfm;

R=1/beta;
Rh=1/beta;
Rf=1/beta;

MM=beta*((1-taok)*Rb-R);
aa=MM;
bb=-(1-sigma2)*(theta+MM)
cc=(1-sigma2)*theta;
niu=(-bb-(bb^2-4*aa*cc)^(1/2))/(2*aa);
miu=MM*niu;
QS=Be+Br;
phit=niu/(theta-miu);
omega=niu;
Nb=QS/phit;
D=(phit-1)*Nb;
ksi=Nb*(1+sigma2*R*(phit-1))/(Rb*QS)-sigma2;


qke=1;
qkr=1;
pai=1;
paih=1;


Bh=(EXY*Y-IM)/(Rh-1);

H=Ye/dlth;
Lambda=beta;
lame=1/Ce;
lamr=1/Cr;
lambe=(1-betae*Rb)*lame;
lambr=(1-betae*Rb)*lamr;
X=1.05;
thetae=thetaess;
thetar=thetarss;
EX=EXY*Y;
posi=posiss;
miuf=1;




























































