%ADEXPS     plot estimates of advertising expenditures from Universal
%           McCann and Magna Global.
%
%           Ellen McGrattan, 2-4-2012

load adexp.dat
load adrev.dat
load ../BEA/NIPA/dgdp4711.dat

te      = adexp(:,1);
e       = adexp(:,2)/1000;
tr      = adrev(:,1);
r       = adrev(:,2)/1000;
ry      = adrev(:,3)/1000;
trend   = length(tr);
i       = find(dgdp4711(1,:)>=te(1) & dgdp4711(1,:)<=tr(trend));
gdp     = dgdp4711(3,i)';
j       = dgdp4711(1,i)';
gdpa    = zeros(4,length(gdp)/4);
t       = gdpa;
gdpa(:) = gdp;
t(:)    = j;
gdpa    = mean(gdpa)';
t       = t(1,:)';

teend   = length(te);
trbeg   = find(tr==te(teend));
exps    = [e(1:teend-1);r(trbeg:trend)*e(teend)/r(trbeg)];

figure(1)
plot(tr,r./ry*100)
title('Advertising Revenues Relative to GDP','Fontsize',16);

figure(2)
plot(t,exps./gdpa*100)
title('Advertising Expenditures Relative to GDP','Fontsize',16);
