% function y = irf(dr, e1, long, drop, replic, iorder)

% function y = irf(dr, e1, long, drop, replic, iorder)
% Computes impulse response functions
% 
% INPUTS
%    dr:     structure of decisions rules for stochastic simulations
%    e1:     exogenous variables value in time 1 after one shock
%    long
%    drop:   truncation (in order 2)
%    replic: number of replications (in order 2)
%    iorder: first or second order approximation
%
% OUTPUTS
%    y:      impulse response matrix
%        
% SPECIAL REQUIREMENTS
%    none

% Copyright (C) 2003-2008 Dynare Team
%
% This file is part of Dynare.
%
% Dynare is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% Dynare is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with Dynare.  If not, see <http://www.gnu.org/licenses/>.

%   global M_ oo_ options_
%%
load Buba_Fiskal_Erweiterung_30_01_results
long = size(oo_.SmoothedShocks.nua_a,1)+1;
iorder =1;% options_.order;
SS(M_.exo_names_orig_ord,M_.exo_names_orig_ord)=M_.Sigma_e+1e-14*eye(M_.exo_nbr);
cs = transpose(chol(SS));
e1 = cs(M_.exo_names_orig_ord,3);
ex2 = zeros(long,M_.exo_nbr);
ex2(1,:) = e1';
ex2(2:end,:)=[oo_.SmoothedShocks.nua_a, oo_.SmoothedShocks.nub_a, oo_.SmoothedShocks.nua_etheta, oo_.SmoothedShocks.nub_etheta, oo_.SmoothedShocks.nua_ethetaw, oo_.SmoothedShocks.nub_ethetaw, oo_.SmoothedShocks.nua_eb, oo_.SmoothedShocks.nub_eb, oo_.SmoothedShocks.nua_en, oo_.SmoothedShocks.nub_en, oo_.SmoothedShocks.nua_ein, oo_.SmoothedShocks.nub_ein, oo_.SmoothedShocks.nua_erp, oo_.SmoothedShocks.nub_erp, oo_.SmoothedShocks.nua_ecG, oo_.SmoothedShocks.nub_ecG, oo_.SmoothedShocks.nua_etau, oo_.SmoothedShocks.nub_etau, oo_.SmoothedShocks.nua_etauw, oo_.SmoothedShocks.nub_etauw, oo_.SmoothedShocks.nua_etausc, oo_.SmoothedShocks.nub_etausc, oo_.SmoothedShocks.nua_etauk, oo_.SmoothedShocks.nub_etauk, oo_.SmoothedShocks.nua_etauc, oo_.SmoothedShocks.nub_etauc, oo_.SmoothedShocks.nua_einG, oo_.SmoothedShocks.nub_einG, oo_.SmoothedShocks.nua_enG, oo_.SmoothedShocks.nub_enG, oo_.SmoothedShocks.nua_UB, oo_.SmoothedShocks.nub_UB, oo_.SmoothedShocks.nua_eTR, oo_.SmoothedShocks.nub_eTR, oo_.SmoothedShocks.nua_eT, oo_.SmoothedShocks.nub_eT, oo_.SmoothedShocks.nua_emg, oo_.SmoothedShocks.nub_emg, oo_.SmoothedShocks.nua_eM, oo_.SmoothedShocks.nua_RoW, oo_.SmoothedShocks.nub_RoW, oo_.SmoothedShocks.nua_RoE, oo_.SmoothedShocks.nub_RoE, oo_.SmoothedShocks.eps_y_c, oo_.SmoothedShocks.eps_i_c, oo_.SmoothedShocks.eps_pi_c, oo_.SmoothedShocks.eps_z_g, oo_.SmoothedShocks.e_my_c, oo_.SmoothedShocks.e_mpiy_c, oo_.SmoothedShocks.e_mi3m_c, oo_.SmoothedShocks.e_mex_row_a, oo_.SmoothedShocks.e_mex_row_b, oo_.SmoothedShocks.e_my_a, oo_.SmoothedShocks.e_my_b];
load Buba_Fiskal_Erweiterung_FU_baseline_results
temps = repmat(oo_.dr.ys,1,M_.maximum_lag);
y1 = simultBuba_Fiskal_Erweiterung_FU_baseline_(temps,oo_.dr,ex2,iorder);
save Buba_FU1 'y1';



load Buba_Fiskal_Erweiterung_30_01_results
long = size(oo_.SmoothedShocks.nua_a,1)+1;
iorder = 1;% options_.order;
SS(M_.exo_names_orig_ord,M_.exo_names_orig_ord)=M_.Sigma_e+1e-14*eye(M_.exo_nbr);
cs = transpose(chol(SS));
e1 = cs(M_.exo_names_orig_ord,3);
ex2 = zeros(long,M_.exo_nbr);
ex2(1,:) = e1';
ex2(2:end,:)=[oo_.SmoothedShocks.nua_a, oo_.SmoothedShocks.nub_a, oo_.SmoothedShocks.nua_etheta, oo_.SmoothedShocks.nub_etheta, oo_.SmoothedShocks.nua_ethetaw, oo_.SmoothedShocks.nub_ethetaw, oo_.SmoothedShocks.nua_eb, oo_.SmoothedShocks.nub_eb, oo_.SmoothedShocks.nua_en, oo_.SmoothedShocks.nub_en, oo_.SmoothedShocks.nua_ein, oo_.SmoothedShocks.nub_ein, oo_.SmoothedShocks.nua_erp, oo_.SmoothedShocks.nub_erp, oo_.SmoothedShocks.nua_ecG, oo_.SmoothedShocks.nub_ecG, oo_.SmoothedShocks.nua_etau, oo_.SmoothedShocks.nub_etau, oo_.SmoothedShocks.nua_etauw, oo_.SmoothedShocks.nub_etauw, oo_.SmoothedShocks.nua_etausc, oo_.SmoothedShocks.nub_etausc, oo_.SmoothedShocks.nua_etauk, oo_.SmoothedShocks.nub_etauk, oo_.SmoothedShocks.nua_etauc, oo_.SmoothedShocks.nub_etauc, oo_.SmoothedShocks.nua_einG, oo_.SmoothedShocks.nub_einG, oo_.SmoothedShocks.nua_enG, oo_.SmoothedShocks.nub_enG, oo_.SmoothedShocks.nua_UB, oo_.SmoothedShocks.nub_UB, oo_.SmoothedShocks.nua_eTR, oo_.SmoothedShocks.nub_eTR, oo_.SmoothedShocks.nua_eT, oo_.SmoothedShocks.nub_eT, oo_.SmoothedShocks.nua_emg, oo_.SmoothedShocks.nub_emg, oo_.SmoothedShocks.nua_eM, oo_.SmoothedShocks.nua_RoW, oo_.SmoothedShocks.nub_RoW, oo_.SmoothedShocks.nua_RoE, oo_.SmoothedShocks.nub_RoE, oo_.SmoothedShocks.eps_y_c, oo_.SmoothedShocks.eps_i_c, oo_.SmoothedShocks.eps_pi_c, oo_.SmoothedShocks.eps_z_g, oo_.SmoothedShocks.e_my_c, oo_.SmoothedShocks.e_mpiy_c, oo_.SmoothedShocks.e_mi3m_c, oo_.SmoothedShocks.e_mex_row_a, oo_.SmoothedShocks.e_mex_row_b, oo_.SmoothedShocks.e_my_a, oo_.SmoothedShocks.e_my_b];
load Buba_Fiskal_Erweiterung_FU_Eq_results    
temps = repmat(oo_.dr.ys,1,M_.maximum_lag);
y2 = simultBuba_Fiskal_Erweiterung_FU_Eq_(temps,oo_.dr,ex2,iorder);
save Buba_FU2 'y2';


load Buba_Fiskal_Erweiterung_30_01_results
long = size(oo_.SmoothedShocks.nua_a,1)+1;
iorder = 1;%options_.order;
SS(M_.exo_names_orig_ord,M_.exo_names_orig_ord)=M_.Sigma_e+1e-14*eye(M_.exo_nbr);
cs = transpose(chol(SS));
e1 = cs(M_.exo_names_orig_ord,3);
ex2 = zeros(long,M_.exo_nbr);
ex2(1,:) = e1';
ex2(2:end,:)=[oo_.SmoothedShocks.nua_a, oo_.SmoothedShocks.nub_a, oo_.SmoothedShocks.nua_etheta, oo_.SmoothedShocks.nub_etheta, oo_.SmoothedShocks.nua_ethetaw, oo_.SmoothedShocks.nub_ethetaw, oo_.SmoothedShocks.nua_eb, oo_.SmoothedShocks.nub_eb, oo_.SmoothedShocks.nua_en, oo_.SmoothedShocks.nub_en, oo_.SmoothedShocks.nua_ein, oo_.SmoothedShocks.nub_ein, oo_.SmoothedShocks.nua_erp, oo_.SmoothedShocks.nub_erp, oo_.SmoothedShocks.nua_ecG, oo_.SmoothedShocks.nub_ecG, oo_.SmoothedShocks.nua_etau, oo_.SmoothedShocks.nub_etau, oo_.SmoothedShocks.nua_etauw, oo_.SmoothedShocks.nub_etauw, oo_.SmoothedShocks.nua_etausc, oo_.SmoothedShocks.nub_etausc, oo_.SmoothedShocks.nua_etauk, oo_.SmoothedShocks.nub_etauk, oo_.SmoothedShocks.nua_etauc, oo_.SmoothedShocks.nub_etauc, oo_.SmoothedShocks.nua_einG, oo_.SmoothedShocks.nub_einG, oo_.SmoothedShocks.nua_enG, oo_.SmoothedShocks.nub_enG, oo_.SmoothedShocks.nua_UB, oo_.SmoothedShocks.nub_UB, oo_.SmoothedShocks.nua_eTR, oo_.SmoothedShocks.nub_eTR, oo_.SmoothedShocks.nua_eT, oo_.SmoothedShocks.nub_eT, oo_.SmoothedShocks.nua_emg, oo_.SmoothedShocks.nub_emg, oo_.SmoothedShocks.nua_eM, oo_.SmoothedShocks.nua_RoW, oo_.SmoothedShocks.nub_RoW, oo_.SmoothedShocks.nua_RoE, oo_.SmoothedShocks.nub_RoE, oo_.SmoothedShocks.eps_y_c, oo_.SmoothedShocks.eps_i_c, oo_.SmoothedShocks.eps_pi_c, oo_.SmoothedShocks.eps_z_g, oo_.SmoothedShocks.e_my_c, oo_.SmoothedShocks.e_mpiy_c, oo_.SmoothedShocks.e_mi3m_c, oo_.SmoothedShocks.e_mex_row_a, oo_.SmoothedShocks.e_mex_row_b, oo_.SmoothedShocks.e_my_a, oo_.SmoothedShocks.e_my_b];
load Buba_Fiskal_Erweiterung_FU_TH_results
temps = repmat(oo_.dr.ys,1,M_.maximum_lag);
y3 = simultBuba_Fiskal_Erweiterung_FU_TH_(temps,oo_.dr,ex2,iorder);
save Buba_FU3 'y3';


load Buba_Fiskal_Erweiterung_30_01_results
long = size(oo_.SmoothedShocks.nua_a,1)+1;
iorder = 1;%options_.order;
SS(M_.exo_names_orig_ord,M_.exo_names_orig_ord)=M_.Sigma_e+1e-14*eye(M_.exo_nbr);
cs = transpose(chol(SS));
e1 = cs(M_.exo_names_orig_ord,3);
ex2 = zeros(long,M_.exo_nbr);
ex2(1,:) = e1';
ex2(2:end,:)=[oo_.SmoothedShocks.nua_a, oo_.SmoothedShocks.nub_a, oo_.SmoothedShocks.nua_etheta, oo_.SmoothedShocks.nub_etheta, oo_.SmoothedShocks.nua_ethetaw, oo_.SmoothedShocks.nub_ethetaw, oo_.SmoothedShocks.nua_eb, oo_.SmoothedShocks.nub_eb, oo_.SmoothedShocks.nua_en, oo_.SmoothedShocks.nub_en, oo_.SmoothedShocks.nua_ein, oo_.SmoothedShocks.nub_ein, oo_.SmoothedShocks.nua_erp, oo_.SmoothedShocks.nub_erp, oo_.SmoothedShocks.nua_ecG, oo_.SmoothedShocks.nub_ecG, oo_.SmoothedShocks.nua_etau, oo_.SmoothedShocks.nub_etau, oo_.SmoothedShocks.nua_etauw, oo_.SmoothedShocks.nub_etauw, oo_.SmoothedShocks.nua_etausc, oo_.SmoothedShocks.nub_etausc, oo_.SmoothedShocks.nua_etauk, oo_.SmoothedShocks.nub_etauk, oo_.SmoothedShocks.nua_etauc, oo_.SmoothedShocks.nub_etauc, oo_.SmoothedShocks.nua_einG, oo_.SmoothedShocks.nub_einG, oo_.SmoothedShocks.nua_enG, oo_.SmoothedShocks.nub_enG, oo_.SmoothedShocks.nua_UB, oo_.SmoothedShocks.nub_UB, oo_.SmoothedShocks.nua_eTR, oo_.SmoothedShocks.nub_eTR, oo_.SmoothedShocks.nua_eT, oo_.SmoothedShocks.nub_eT, oo_.SmoothedShocks.nua_emg, oo_.SmoothedShocks.nub_emg, oo_.SmoothedShocks.nua_eM, oo_.SmoothedShocks.nua_RoW, oo_.SmoothedShocks.nub_RoW, oo_.SmoothedShocks.nua_RoE, oo_.SmoothedShocks.nub_RoE, oo_.SmoothedShocks.eps_y_c, oo_.SmoothedShocks.eps_i_c, oo_.SmoothedShocks.eps_pi_c, oo_.SmoothedShocks.eps_z_g, oo_.SmoothedShocks.e_my_c, oo_.SmoothedShocks.e_mpiy_c, oo_.SmoothedShocks.e_mi3m_c, oo_.SmoothedShocks.e_mex_row_a, oo_.SmoothedShocks.e_mex_row_b, oo_.SmoothedShocks.e_my_a, oo_.SmoothedShocks.e_my_b];
load Buba_Fiskal_Erweiterung_FU_CA_results
temps = repmat(oo_.dr.ys,1,M_.maximum_lag);
y4 = simultBuba_Fiskal_Erweiterung_FU_CA_(temps,oo_.dr,ex2,iorder);
save Buba_FU4 'y4';


load Buba_FU1
load Buba_FU2
load Buba_FU3
load Buba_FU4


%% Evolution of real variables
t=1:long+1;
ZeroLine=zeros(size(t,2),1);
f = figure;
% figure('Position',[1 1 700 1000]);
set(f, 'InvertHardcopy','off','Color',[1 1 1],'Position',[1 1 700 1000]);
subplot (4,2,1); 
   plot(t,y1(strmatch('GDP_a_t',M_.endo_names,'exact'),1:end)/y1(strmatch('GDP_a_t',M_.endo_names,'exact'),1)*100,'b-+','LineWidth',1,'MarkerSize',3)
   hold on
   plot(t,y2(strmatch('GDP_a_t',M_.endo_names,'exact'),1:end)/y1(strmatch('GDP_a_t',M_.endo_names,'exact'),1)*100,'r-*','LineWidth',1,'MarkerSize',3)
   hold on
   plot(t,y3(strmatch('GDP_a_t',M_.endo_names,'exact'),1:end)/y1(strmatch('GDP_a_t',M_.endo_names,'exact'),1)*100,'g-+','LineWidth',1,'MarkerSize',3)
   hold on
   plot(t,y4(strmatch('GDP_a_t',M_.endo_names,'exact'),1:end)/y1(strmatch('GDP_a_t',M_.endo_names,'exact'),1)*100,'m-+','LineWidth',1,'MarkerSize',3)
%     hold on
%    plot(t,ZeroLine,'k','LineWidth',1);
   title('GE GDP','FontSize',11,'FontWeight','Bold');
   xlabel ('time');
%   axis([1 60 0.7 1.05])
subplot (4,2,2); 
   plot(t,y1(strmatch('GDP_b_t',M_.endo_names,'exact'),1:end)/y1(strmatch('GDP_b_t',M_.endo_names,'exact'),1)*100,'b-+','LineWidth',1,'MarkerSize',3)
   hold on
   plot(t,y2(strmatch('GDP_b_t',M_.endo_names,'exact'),1:end)/y1(strmatch('GDP_b_t',M_.endo_names,'exact'),1)*100,'r-*','LineWidth',1,'MarkerSize',3)
   hold on
   plot(t,y3(strmatch('GDP_b_t',M_.endo_names,'exact'),1:end)/y1(strmatch('GDP_b_t',M_.endo_names,'exact'),1)*100,'g-+','LineWidth',1,'MarkerSize',3)
   hold on
   plot(t,y4(strmatch('GDP_b_t',M_.endo_names,'exact'),1:end)/y1(strmatch('GDP_b_t',M_.endo_names,'exact'),1)*100,'m-+','LineWidth',1,'MarkerSize',3)
%     hold on
%    plot(t,ZeroLine,'k','LineWidth',1);
   title('RoE GDP','FontSize',11,'FontWeight','Bold');
   xlabel ('time');
subplot (4,2,3); 
   plot(t,y1(strmatch('c_a_t',M_.endo_names,'exact'),1:end)/y1(strmatch('c_a_t',M_.endo_names,'exact'),1)*100,'b-+','LineWidth',1,'MarkerSize',3)
   hold on
   plot(t,y2(strmatch('c_a_t',M_.endo_names,'exact'),1:end)/y1(strmatch('c_a_t',M_.endo_names,'exact'),1)*100,'r-*','LineWidth',1,'MarkerSize',3)
   hold on
   plot(t,y3(strmatch('c_a_t',M_.endo_names,'exact'),1:end)/y1(strmatch('c_a_t',M_.endo_names,'exact'),1)*100,'g-+','LineWidth',1,'MarkerSize',3)
   hold on
   plot(t,y4(strmatch('c_a_t',M_.endo_names,'exact'),1:end)/y1(strmatch('c_a_t',M_.endo_names,'exact'),1)*100,'m-+','LineWidth',1,'MarkerSize',3)
%     hold on
%    plot(t,ZeroLine,'k','LineWidth',1);
   title ('GE pr. consumption','FontSize',11,'FontWeight','Bold');
   xlabel ('time');
subplot (4,2,4); 
   plot(t,y1(strmatch('c_b_t',M_.endo_names,'exact'),1:end)/y1(strmatch('c_b_t',M_.endo_names,'exact'),1)*100,'b-+','LineWidth',1,'MarkerSize',3)
   hold on
   plot(t,y2(strmatch('c_b_t',M_.endo_names,'exact'),1:end)/y1(strmatch('c_b_t',M_.endo_names,'exact'),1)*100,'r-*','LineWidth',1,'MarkerSize',3)
   hold on
   plot(t,y3(strmatch('c_b_t',M_.endo_names,'exact'),1:end)/y1(strmatch('c_b_t',M_.endo_names,'exact'),1)*100,'g-+','LineWidth',1,'MarkerSize',3)
   hold on
   plot(t,y4(strmatch('c_b_t',M_.endo_names,'exact'),1:end)/y1(strmatch('c_b_t',M_.endo_names,'exact'),1)*100,'m-+','LineWidth',1,'MarkerSize',3)
%    hold on
%    plot(t,ZeroLine,'k','LineWidth',1);
   title ('RoE pr. consumption','FontSize',11,'FontWeight','Bold');
   xlabel ('time');
%   axis([1 60 2.5 3.5])
subplot (4,2,5); 
   plot(t,y1(strmatch('in_a_t',M_.endo_names,'exact'),1:end)/y1(strmatch('in_a_t',M_.endo_names,'exact'),1)*100,'b-+','LineWidth',1,'MarkerSize',3)
   hold on
   plot(t,y2(strmatch('in_a_t',M_.endo_names,'exact'),1:end)/y1(strmatch('in_a_t',M_.endo_names,'exact'),1)*100,'r-*','LineWidth',1,'MarkerSize',3)
   hold on
   plot(t,y3(strmatch('in_a_t',M_.endo_names,'exact'),1:end)/y1(strmatch('in_a_t',M_.endo_names,'exact'),1)*100,'g-+','LineWidth',1,'MarkerSize',3)
   hold on
   plot(t,y4(strmatch('in_a_t',M_.endo_names,'exact'),1:end)/y1(strmatch('in_a_t',M_.endo_names,'exact'),1)*100,'m-+','LineWidth',1,'MarkerSize',3)
%     hold on
%    plot(t,ZeroLine,'k','LineWidth',1);
   title ('GE pr. investment','FontSize',11,'FontWeight','Bold');
   xlabel ('time');
subplot (4,2,6); 
   plot(t,y1(strmatch('in_b_t',M_.endo_names,'exact'),1:end)/y1(strmatch('in_b_t',M_.endo_names,'exact'),1)*100,'b-+','LineWidth',1,'MarkerSize',3)
   hold on
   plot(t,y2(strmatch('in_b_t',M_.endo_names,'exact'),1:end)/y1(strmatch('in_b_t',M_.endo_names,'exact'),1)*100,'r-*','LineWidth',1,'MarkerSize',3)
   hold on
   plot(t,y3(strmatch('in_b_t',M_.endo_names,'exact'),1:end)/y1(strmatch('in_b_t',M_.endo_names,'exact'),1)*100,'g-+','LineWidth',1,'MarkerSize',3)
   hold on
   plot(t,y4(strmatch('in_b_t',M_.endo_names,'exact'),1:end)/y1(strmatch('in_b_t',M_.endo_names,'exact'),1)*100,'m-+','LineWidth',1,'MarkerSize',3)
%     hold on
%    plot(t,ZeroLine,'k','LineWidth',1);
   title ('RoE pr. investment','FontSize',11,'FontWeight','Bold');
   xlabel ('time');
subplot (4,2,7); 
   plot(t,(y1(strmatch('BG_a_t',M_.endo_names,'exact'),1:end)./y1(strmatch('GDP_a_t',M_.endo_names,'exact'),1:end)*100/4),'b-+','LineWidth',1,'MarkerSize',3)
   hold on
   plot(t,(y2(strmatch('BG_a_t',M_.endo_names,'exact'),1:end)./y2(strmatch('GDP_a_t',M_.endo_names,'exact'),1:end)*100/4),'r-*','LineWidth',1,'MarkerSize',3)
   hold on
   plot(t,(y3(strmatch('BG_a_t',M_.endo_names,'exact'),1:end)./y3(strmatch('GDP_a_t',M_.endo_names,'exact'),1:end)*100/4),'g-+','LineWidth',1,'MarkerSize',3)
   hold on
   plot(t,((M_.params(strmatch('pop_a',M_.param_names,'exact'))+M_.params(strmatch('pop_b',M_.param_names,'exact')))*y4(strmatch('BG_EU_t',M_.endo_names,'exact'),1:end)./(M_.params(strmatch('pop_a',M_.param_names,'exact'))*y4(strmatch('GDP_a_t',M_.endo_names,'exact'),1:end) + M_.params(strmatch('pop_b',M_.param_names,'exact'))*y4(strmatch('GDP_b_t',M_.endo_names,'exact'),1:end))*100/4),'m-+','LineWidth',1,'MarkerSize',3)   
%     hold on
%    plot(t,ZeroLine,'k','LineWidth',1);
   title ('GE debt-to-GDP','FontSize',11,'FontWeight','Bold');
   xlabel ('time');
subplot (4,2,8); 
   plot(t,(y1(strmatch('BG_b_t',M_.endo_names,'exact'),1:end)./y1(strmatch('GDP_b_t',M_.endo_names,'exact'),1:end)*100/4),'b-+','LineWidth',1,'MarkerSize',3)
   hold on
   plot(t,(y2(strmatch('BG_b_t',M_.endo_names,'exact'),1:end)./y2(strmatch('GDP_b_t',M_.endo_names,'exact'),1:end)*100/4),'r-*','LineWidth',1,'MarkerSize',3)
   hold on
   plot(t,(y3(strmatch('BG_b_t',M_.endo_names,'exact'),1:end)./y3(strmatch('GDP_b_t',M_.endo_names,'exact'),1:end)*100/4),'g-+','LineWidth',1,'MarkerSize',3)
   hold on
   plot(t,((M_.params(strmatch('pop_a',M_.param_names,'exact'))+M_.params(strmatch('pop_b',M_.param_names,'exact')))*y4(strmatch('BG_EU_t',M_.endo_names,'exact'),1:end)./(M_.params(strmatch('pop_a',M_.param_names,'exact'))*y4(strmatch('GDP_a_t',M_.endo_names,'exact'),1:end) + M_.params(strmatch('pop_b',M_.param_names,'exact'))*y4(strmatch('GDP_b_t',M_.endo_names,'exact'),1:end))*100/4),'m-+','LineWidth',1,'MarkerSize',3)   
   
%     hold on
%    plot(t,ZeroLine,'k','LineWidth',1);
   title ('RoE debt-to-GDP','FontSize',11,'FontWeight','Bold');
   xlabel ('time');
h_legend=legend('SQ','RE','TH','CA','Orientation','horizontal','Location','SouthOutside');
%    legend('boxoff');
    pos = get(h_legend,'Position');
    pos(1) = 0.253;
    pos(2) = 0.038;
    pos(3) = 0.53;
    pos(4) = 0.033;
    set(h_legend,'Position',pos);
    set(h_legend,'FontSize',13,'FontWeight','Bold');
   %legendshrink(0.4,'right',h_legend)
%saveas(gcf,'R:\Zentrale\ZB-Vo\Daten\Vo2_Gesamt\Hollmayr_Staehler_gemeinsame_Projekte\Fiscal_Union\New_Code\Counterfactual.eps','epsc') 

