%==========================================================================
%         Paper parameters
%==========================================================================

clear all
close all


h = 0.7;
gamma = 0.5;
delta = 0.025;
mu = 6;
a0 = 1;
alpha0 = 0.97;
theta = 0.16;
Rz = 1.0432;
R0 = 1.0072;
beta = 0.9915;
X10 = 0.00695;
X2 = 0.00099;
omega = 0.0124;
phi_l = 0.006;
phi_y = 0.2015;
phi_pi = 0.595;
phi_p = 6.0929;
phi_k = 3.1988;
rho_f = 0.4525;
rho_a = 0.4113;
rho_r = 0.9121;
rho_x1 = 0.866;
sigma_f = 0.0004;
sigma_a = 0.0972;
sigma_r = 0.0006;
sigma_x1 = 0.0007;

%steady state
ass = a0;
alphass = alpha0;
X1ss = X10;
piss = 1.005;
Rss = R0+phi_pi*(piss-1);
RDss = Rss+X10;
Rhatss = Rss+X10+X2;
RLss = piss*phi_l/beta+Rhatss;  
mss = piss*omega/beta/(theta*Rz-RDss+(1-theta)*Rhatss);
dss = beta*(Rhatss-Rss)*mss^2/(omega*piss);
kn = ((1-beta*(1-delta))*RLss/(piss*ass*gamma))^(1/(gamma-1));
wss = (1-gamma)*(1-beta*(1-delta))*kn/(gamma*beta);
nss = 0.33;
kss = kn*nss;
iss = delta*kss;
yss = ass*kn^gamma*nss;
lss = wss*nss+iss;
cpss = phi_p*(piss-1)^2*yss/2;
ckss = 0;
css = yss-iss-cpss-ckss-phi_l*lss-omega*dss/mss;
mcss =(1-beta*h)/css/(1-h);
btaoss = lss+mss-(1-theta)*dss;
bss = (1-alphass)*(css+dss)/alphass;
nbss = theta*dss+mss+bss-btaoss;
lambdass = alphass*piss*mcss/(piss-beta*(1-alphass)*Rss);
xiss = beta*Rss*lambdass/piss-mcss;
X = lambdass*wss;
phi_d =((piss-beta*RDss)*lambdass-piss*xiss*(1-alphass))/((piss-1)*(beta/piss-1)*dss);


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

%run the dynare mod file or the compiled mod m file
dynare CBDC_paper1;

