clear; close all; clc 

addpath C:\dynare\4.4.3
addpath C:\dynare\4.4.3\matlab

% cd C:\Users\Aaron\Desktop\Examples\AEJ\
% dynare jules1.mod
% close all;
% break;


load jules1_results.mat;
%%%% The baseline model
ex_= [
oo_.SmoothedShocks.Mean.eps_c ,...
oo_.SmoothedShocks.Mean.eps_e ,...
oo_.SmoothedShocks.Mean.eps_h ,...
oo_.SmoothedShocks.Mean.eps_j ,...
oo_.SmoothedShocks.Mean.eps_k ,...
oo_.SmoothedShocks.Mean.eps_p ,...
oo_.SmoothedShocks.Mean.eps_s ,...
oo_.SmoothedShocks.Mean.eps_t ,...
oo_.SmoothedShocks.Mean.eps_z
];

ex_ = ex_(2:end,:);
% ex_ = zeros(size(ex_));


oo_.dr.ys = [
oo_.SmoothedVariables.Mean.a_c(1);  
oo_.SmoothedVariables.Mean.a_h(1);  
oo_.SmoothedVariables.Mean.a_j(1);  
oo_.SmoothedVariables.Mean.a_k(1);  
oo_.SmoothedVariables.Mean.a_s(1);  
oo_.SmoothedVariables.Mean.a_t(1);  
oo_.SmoothedVariables.Mean.a_z(1);  
oo_.SmoothedVariables.Mean.b(1);  
oo_.SmoothedVariables.Mean.c(1);  
oo_.SmoothedVariables.Mean.c1(1); 
oo_.SmoothedVariables.Mean.data_CC(1);  
oo_.SmoothedVariables.Mean.data_DP(1);  
oo_.SmoothedVariables.Mean.data_IH(1);  
oo_.SmoothedVariables.Mean.data_IK(1);  
oo_.SmoothedVariables.Mean.data_NC(1);  
oo_.SmoothedVariables.Mean.data_NH(1);  
oo_.SmoothedVariables.Mean.data_QQ(1);  
oo_.SmoothedVariables.Mean.data_RR(1);  
oo_.SmoothedVariables.Mean.data_WC(1);  
oo_.SmoothedVariables.Mean.data_WH(1); 
oo_.SmoothedVariables.Mean.dp(1);  
oo_.SmoothedVariables.Mean.h(1);  
oo_.SmoothedVariables.Mean.h1(1);  
oo_.SmoothedVariables.Mean.I(1);  
oo_.SmoothedVariables.Mean.kc(1);  
oo_.SmoothedVariables.Mean.kh(1);  
oo_.SmoothedVariables.Mean.lm(1);  
oo_.SmoothedVariables.Mean.nc(1);  
oo_.SmoothedVariables.Mean.nc1(1);  
oo_.SmoothedVariables.Mean.nh(1);  
oo_.SmoothedVariables.Mean.nh1(1);  
oo_.SmoothedVariables.Mean.q(1);  
oo_.SmoothedVariables.Mean.r(1);  
oo_.SmoothedVariables.Mean.rkc(1);  
oo_.SmoothedVariables.Mean.rkh(1); 
oo_.SmoothedVariables.Mean.uc(1);  
oo_.SmoothedVariables.Mean.uc1(1);  
oo_.SmoothedVariables.Mean.wc(1);  
oo_.SmoothedVariables.Mean.wc1(1);  
oo_.SmoothedVariables.Mean.wh(1);  
oo_.SmoothedVariables.Mean.wh1(1);  
oo_.SmoothedVariables.Mean.X(1);  
oo_.SmoothedVariables.Mean.xwc(1);  
oo_.SmoothedVariables.Mean.xwc1(1);  
oo_.SmoothedVariables.Mean.xwh(1);  
oo_.SmoothedVariables.Mean.xwh1(1);  
oo_.SmoothedVariables.Mean.Y(1);  
oo_.SmoothedVariables.Mean.zata_GDP(1);  
oo_.SmoothedVariables.Mean.zkc(1);  
oo_.SmoothedVariables.Mean.zkh(1)
];
   
dr = oo_.dr;
y0 = oo_.dr.ys;
iorder=1;
y_=simult_(y0,dr,ex_,iorder);


data_CC = y_(11,:)';
data_DP = y_(12,:)';
data_IH = y_(13,:)';
data_IK = y_(14,:)';
data_NC = y_(15,:)';
data_NH = y_(16,:)';
data_QQ = y_(17,:)';
data_RR = y_(18,:)';
data_WC = y_(19,:)';
data_WH = y_(20,:)';


SimulData = [data_CC,data_DP,data_IH,data_IK,data_NC,data_NH,data_QQ,data_RR,data_WC,data_WH];