x = xlsread('oil.xls')

output_gap = x(:,1);
interest_rate = x(:,2);
core_inflation = x(:,3)*4;
%multipliquei a taxa de inflação por 4 para transformar ela em anual
ca = x(:,4);
labor = x(:,5);
%prs = x(:,6);
%oil_price = x(:,6);
consumption = x(:,6);
investment = x(:,7);
juros_externos = x(:,8);
%world_growth = x(:,9);
fx = x(:,9);
%com = x(:,11);
infstar = x(:,10);
oil_price = x(:,11);
imp = x(:,12);
com = x(:,13);

% os dados têm que ir do 3o tri de 96 até o 1o tri de 2013
% O vetor t abaixo da valores para o eixo x do gráfico
% Assim, o intervalo de 0.25 corresponde a 1 trimestre
%1996.75 corresponde ao 3o tri de 1996 e 2013 corresponde ao 1o tri de 
%2013. Seguindo esta lógica, para montar o vetor de datas, teríamos:
% 25: 1o tri
% 50: 2o tri
% 75: 3o tri
% 00: 4o tri


t = (1999.75:0.25:2013.25)';

figure
set(gcf,'Name','Data for estimation (hp filtered)');
subplot(431)
plot(t,output_gap,'b.-')
title('Hiato do produto')
axis([min(t)-0.25, max(t)+0.25, min(output_gap)-.015 max(output_gap)+.015])

%subplot(432)
%plot(t,commodity_production,'b.-')
%title('Produção de commodities')
%axis([min(t)-0.25, max(t)+0.25, min(commodity_production)-0.015 max(commodity_production)+0.015])

subplot(432)
plot(t,interest_rate,'b.-')
title('Selic')
axis([min(t)-0.25, max(t)+0.25, min(interest_rate)-0.015 max(interest_rate)+0.015])

subplot(433)
plot(t,core_inflation,'b.-')
title('Inflação')
axis([min(t)-0.25, max(t)+0.25, min(core_inflation)-0.015 max(core_inflation)+0.015])


subplot(434)
plot(t,ca,'b.-')
title('Conta-corrente em % do PIB')
axis([min(t)-0.25, max(t)+0.25, min(ca)-0.015 max(ca)+0.015])

subplot(435)
plot(t,labor,'b.-')
title('Caged')
axis([min(t)-0.25, max(t)+0.25, min(labor)-0.015 max(labor)+0.015])

subplot(4,3,6)
plot(t,consumption,'b.-')
title('Consumo')
axis([min(t)-0.25, max(t)+0.25, min(consumption)-0.015 max(consumption)+0.015])

subplot(4,3,7)
plot(t,investment,'b.-')
title('Investimento')
axis([min(t)-0.25, max(t)+0.25, min(investment)-0.015 max(investment)+0.015])

subplot(4,3,8)
plot(t,juros_externos,'b.-')
title('Taxa de juros EUA')
axis([min(t)-0.25, max(t)+0.25, min(juros_externos)-0.015 max(juros_externos)+0.015])

%subplot(5,3,9)
%plot(t,world_growth,'b.-')
%title('Crescimento mundial')
%axis([min(t)-0.25, max(t)+0.25, min(world_growth)-0.015 max(world_growth)+0.015])

subplot(4,3,9)
plot(t,fx,'b.-')
title('Câmbio nominal')
axis([min(t)-0.25, max(t)+0.25, min(fx)-0.015 max(fx)+0.015])



subplot(4,3,10)
plot(t,infstar,'b.-')
title('inflação externa')
axis([min(t)-0.25, max(t)+0.25, min(infstar)-0.015 max(infstar)+0.015])

subplot(4,3,11)
plot(t,oil_price,'b.-')
title('Preço do petróleo')
axis([min(t)-0.25, max(t)+0.25, min(oil_price)-0.015 max(oil_price)+0.015])


subplot(4,3,12)
plot(t,imp,'b.-')
title('crescimento mundial')
axis([min(t)-0.25, max(t)+0.25, min(imp)-0.015 max(imp)+0.015])

%subplot(5,3,13)
%plot(t, com,'b.-')
%title('preço importações')
%axis([min(t)-0.25, max(t)+0.25, min(com)-0.015 max(com)+0.015])

% Correspondência entre os nomes das séries na base de dados e no modelo

y_hat = output_gap;
i_hat = interest_rate;
picz_hat = core_inflation;
ca_y_hat = ca;
l_hat = labor;
%prsF_hat = prs;
c_hat = consumption;
inv_hat = investment;
iF_hat = juros_externos;
%dyF_hat = world_growth;
e_hat = fx;
pifF_hat = infstar;
proF_hat = oil_price;
dyF_hat = imp;
%prfF_hat = com;




