
clear all; 
clc;
close all;

siggma = 1;
varphi=5;
phi_pi = 2;
phi_y  = 0.125;
theta=3/4;
rho_nu =0;
%rho_nu =0.5;
%rho_nu =0.4;
rho_z  = 0.5;
rho_a  = 0.9;
rho_r =0.8;
betta  = 0.99;
eta  =3.77; %footnote 11, p. 115
alppha=1/4;
epsilon=9;
tau=0; % or 1/epsilon;
pi_tar =0.000; %0.005; %set inflation target or trend inflation 0.005 for 2% annual inflation
psi = (epsilon-1)*theta/((1-theta)*(1-betta*theta)); %Rotemberg composite parameter


save parameter_testinf3 siggma varphi phi_pi phi_y theta rho_nu rho_z rho_a rho_r betta eta alppha epsilon tau pi_tar psi

%Define simulation period and burnin period
period=200;
drop_period=200;
%% Run model in Rotemberg setup (model_indicator=0)

model_indicator=0; 
fid=fopen('par_def.txt','w+'); 
fprintf(fid,'@#define Calvo = %u \n',model_indicator); 
fclose(fid) ;

dynare testinf31 noclearall
save(' Rotemberg.mat'); % Save workspace.
%clear; % Clear workspace
% To load the workspace 
% load('Rotemberg.mat')

%GIRF computed from simulation for the two setup
%%
T_simul = 1:1:20;

figure 
y= (log_y-log_y_ss);
plot(T_simul, y(1:length(T_simul)),'-kd','LineWidth',1);
xlabel('time');
ylabel('Output');

figure 
p=(pi_ann);
plot(T_simul, p(1:length(T_simul)),'-kd','LineWidth',1);
xlabel('time');
ylabel('pi');
legend('Inflation');

figure
a=(i_ann);
plot(T_simul, a(1:length(T_simul)),'-kd','LineWidth',1);
xlabel('time');
ylabel('i');
legend('Interest rate');

figure
b=(r_real_ann);
plot(T_simul, b(1:length(T_simul)),'-kd','LineWidth',1);
xlabel('time');
ylabel('rreal ');
legend('Real interest rate');



