%% This file defines the parameter values and computes the steady state.

tthetac = 0.44;
ppsi = 0.5;
aalpha = 2/3;
tthetal = 1; %This also matters for rank condition.
bbeta = 0.975;
ssigma=2;

pphiw=5;
pphip=5;

xxi=5;
xxib=1;
xxil=1;
nnu = -log(bbeta);
zzetarho=0.7;
ssigmarho=0.01;
eepsilonw=6;
eepsilonn=6;

% ver=1 if LT/L = oomegal
% ver2 if CT/C = oomegac. Note that with tthetal=1, oomegac=oomegal will
% hold under ver2. Note that with ver2, ssigma=1 can't hold.
ver=1; 

LTLNss = 0.4729;
CTCNss = 0.6143;

if ver==1
    oomegal = (LTLNss)/(1+LTLNss);
    WTWNss = 1;
    ATANss = (CTCNss)*(LTLNss)^(-aalpha);
    PNEss = ATANss*(LTLNss)^(aalpha-1);
    oomegac = (CTCNss*PNEss^(-tthetac))/(1+CTCNss*PNEss^(-tthetac));
    Css=1;
    if tthetac==1
        CNss = oomegac^oomegac*(1-oomegac)^(1-oomegac)*CTCNss^(-oomegac);
    else
        CNss = (oomegac^(1/tthetac)*CTCNss^((tthetac-1)/tthetac) + (1-oomegac)^(1/tthetac))^(-tthetac/(tthetac-1));
    end
    CTss = CTCNss*CNss;
    LNss = (aalpha*CNss^(1-1/tthetac)*(1-oomegac)^(1/tthetac)*(1-oomegal)^ppsi)^(1/(1+ppsi));
    LTss = LTLNss*LNss;
    Lss = (oomegal^(-1/tthetal)*LTss^((tthetal+1)/tthetal) + (1-oomegal)^(-1/tthetal)*LNss^((tthetal+1)/tthetal))^(tthetal/(tthetal+1));
    ANss = CNss/LNss^aalpha;
    ATss = ATANss*ANss;
else
    oomegac = CTCNss/(1+CTCNss);
    PNEss = 1;
    ATANss = CTCNss*(LTLNss)^(-aalpha);
    WTWNss = ATANss*(LTLNss)^(aalpha-1);
    oomegal = ((WTWNss)^(-tthetal)*LTLNss)/(1+(WTWNss)^(-tthetal)*LTLNss);
    Lss = 1;
    LNss = (oomegal^(-1/tthetal)*LTLNss^((tthetal+1)/tthetal) + (1-oomegal)^(-1/tthetal))^(tthetal/(tthetal+1));
    LTss = LTLNss*LNss;
    CNss = ((1-oomegac)^ssigma*aalpha*LNss^(-1+1/tthetal)*(1-oomegal)^(-1/tthetal))^(1/(ssigma-1));
    CTss = CTCNss*CNss;
    
    if tthetac==1
        Css = CTss^oomegac*CNss^(1-oomegac)/(oomegac^oomegac*(1-oomegac)^(1-oomegac));
    else
        Css = (oomegac^(1/tthetac)*CTss^((tthetac-1)/tthetac) + (1-oomegac)^(1/tthetac)*CNss^((tthetac-1)/tthetac))^(tthetac/(tthetac-1));
    end
    
    ANss = CNss/(LNss^(aalpha));
    ATss = ATANss*ANss;
end

CTtilde = oomegac^(1/tthetac)*CTss^((tthetac-1)/tthetac)/Css^((tthetac-1)/tthetac);
CNtilde = (1-oomegac)^(1/tthetac)*CNss^((tthetac-1)/tthetac)/Css^((tthetac-1)/tthetac);
LTtilde = oomegal^(-1/tthetal)*LTss^((tthetal+1)/tthetal)/Lss^((tthetal+1)/tthetal);
LNtilde = (1-oomegal)^(-1/tthetal)*LNss^((tthetal+1)/tthetal)/Lss^((tthetal+1)/tthetal);
UTss = Css^(-ssigma+1/tthetac)*oomegac^(1/tthetac)*CTss^(-1/tthetac);

%kkappa = -aalpha/tthetac*(aalpha/tthetac - 1/tthetal + (1-aalpha) + (ppsi+1/tthetal)*LNtilde)/((aalpha/tthetac-1/tthetal+(1-aalpha))*(ppsi+(1-aalpha)) - aalpha/tthetac*(ppsi+1/tthetal)*LNtilde)
kkappa = -aalpha/tthetac*((ppsi-1/tthetal)*LTtilde*(1/tthetal+aalpha/tthetac+1-aalpha)/((ppsi-1/tthetal)*LNtilde+1/tthetal+aalpha/tthetac+1-aalpha)+1/tthetal+1-aalpha)^(-1);
