%
% FOF Table R100 Change in household net worth (Quarterly, Bil$)
%

load FOF/btabs/rtab100d.dat
rtab100dA    = (qtr2ann(rtab100d))';
nholdgain    = (rtab100dA(10,:)'-rtab100dA(11,:)')*4;
Vnholdgain   = cumsum(nholdgain(1:53));

load FOF/atabs/atab6d.dat
atab6dA      = (qtr2ann(atab6d))';
gdp          = atab6dA(2,1:53)'/1000;


load BEA/NIPA/table1_1_9Q.dat
t            = table1_1_9Q(1,:);
tq           = table1_1_9Q(2,:);
i            = find(t==1952 & tq==1);
j            = find(t==2004 & tq==4);
dgdpq        = table1_1_9Q(3,i:j)';

load BEA/NIPA/table1_1_9A.dat
[n,m]        = size(table1_1_9A);
t            = table1_1_9A(1,:);
i            = find(t==1952);
j            = find(t==2004);
dgdp         = table1_1_9A(2,i:j)';
p            = dgdp/100;                                                                                

ngain        = [Vnholdgain(2:53)-Vnholdgain(1:52)]./gdp(1:52);
rgain        = [Vnholdgain(2:53)./p(2:53)-Vnholdgain(1:52)./p(1:52)]./ ...
               (gdp(1:52)./p(1:52));

plot(1953:2004,rgain,'-*',1953:2004,ngain,'-x')
title('Real and Nominal Holding Gains Relative to GDP (Excluding Real Estate)')

