clear all
close all

% set parameters

alpha      = 0.33;
beta       = 0.98;
sigma      =0.84;
eta        =1.17;
zeta       = 1;
delta      = 0.059;
r_ss       = 1/beta-1;
z_ss       = 1;
rho_z      = 0.139;
sigma_z    = 0.01;
varphi_ss  =0.0602;
rho_varphi =0.9;
sigma_varphi=0.01;
eps_p     = 10;
kappa   =0.0025;


% solve for steady state
z = z_ss; 
r = r_ss; 
Lam = beta;
varphi=varphi_ss;
theta=((1-1/eps_p)*(1-alpha)*(1-beta*varphi_ss)*(1+varphi_ss)+beta*varphi_ss*varphi_ss)/(kappa*beta*varphi_ss + (1-1/eps_p)*(1-alpha)*(1-beta*varphi_ss)*(1+varphi_ss)+beta*varphi_ss*varphi_ss);
w=(1/(beta*varphi_ss*(1-theta)+kappa*beta*theta))*(1-1/eps_p)*(1-alpha)*(1-beta*varphi_ss)*((1-beta*(1-delta))/alpha*beta*(1-beta*varphi_ss)*(1-1/eps_p))^(alpha/(1-alpha));
n =(w/zeta*(((1-beta*(1-delta))/alpha*beta*(1-beta*varphi_ss)*(1-1/eps_p))^(alpha/(1-alpha)) - delta*((1-beta*(1-delta))/alpha*beta*(1-beta*varphi_ss)*(1-1/eps_p))^(1/(1-alpha))))^(1/(eta+sigma));
k =n*((1-beta*(1-delta))/alpha*beta*(1-beta*varphi_ss)*(1-1/eps_p))^(1/(1-alpha));
y=k^(alpha)*n^(1-alpha);
c=y-delta*k;
i = delta*k;


%ws=w;
%thetas=theta;
%ks=k;
%ns=n;
%ys=y;
%cs=c;


ws=log(w);
thetas=log(theta);
ks=log(k);
ns=log(n);
ys=log(y);
cs=log(c);


save param_check alpha beta sigma eta zeta delta kappa eps_p r_ss z_ss rho_z sigma_z varphi_ss rho_varphi sigma_varphi ws thetas ns ks cs ys 

dynare model_withebpp noclearall nolog