%% PARAMETERS FOR DYNARE FILE
bbeta  = 0.99;                    %   time discount factor
risk_aver = 1;                       %   CRRA parameter 
aalpha = 0.36;                     %   steady-state capital share
ddelta = 0.025;                   %   capital depreciation rate                 
rrho = 0.9;                       %   persistence of TFP process
L=0.327;
sigmae=0.1;

% NEED TO GET THE STEADY STATE
%x(1)=c
%x(2)=r
%x(3)=w
%x(4)=y
%x(5)=k
%x(6)=inv
%x(7)=lambda

f=@(x)([x(1)^(-risk_aver)-x(7); ...
    x(2)-aalpha*x(5)^(aalpha-1)*L^(1-aalpha); ...
    x(3)-(1-aalpha)*x(5)^aalpha*L^(-aalpha); ...
    x(1)-x(4)+ddelta*x(5); ...
    ddelta*x(5)-x(6); ...
    1-bbeta*(x(2)+1-ddelta ); ...
    x(4)-x(5)^(aalpha)* L^(1-aalpha);]);
x0=ones(1,7);
options = optimset('Display','iter','MaxIter',100);
SS_model=fsolve(f,x0, options);

css=SS_model(1);
rss=SS_model(2);
wss=SS_model(3);
yss=SS_model(4);
kss=SS_model(5);
invss=SS_model(6);
lambdass=SS_model(7);
