% Output
r_y_prod = r_gdp;
d_y_prod = 400*dif(log(r_y_prod),1);
s_y_prod = q_gdp./q_gdp;
ylist = {
    'pce_goods' ... 
    'exports' ...
    'gov_fed' ...
    'fpi' ...
    'gov' ...
    'gpdi' ...
    'imports' ...
    'pce_goods_dur' ...
    'pce' ...
    'pce_services' ...
    'pce_goods_nondur' ...
    'fpi_nonres' ...
    'fpi_res' ...
    'gov_sl' ...
    'pce_dg_mvp' ...
    'pce_dg_fdhe' ...
    'pce_dg_rgv' ...
    'pce_dg_odg' ...
    'pce_ng_fb' ...
    'pce_ng_cf' ...
    'pce_ng_ge' ...
    'pce_ng_ong' ...
    'pce_s_hu' ...
    'pce_s_hc' ...
    'pce_s_ts' ...
    'pce_s_rs' ...
    'pce_s_fsa' ...
    'pce_s_fsi' ...
    'pce_s_os' ...
    'pce_s_npish' ...
    'pce_xfe' ...
    'pce_egs' ...
    'gpdi_nonres_structures' ...
    'gpdi_nonres_equip' ...
    'gpdi_nonres_ipp' ...
    'gpdi_res_structures' ...
    'gpdi_res_equip' ...
  };
for iseries = 1:size(ylist,2);
    sname = char(ylist(iseries));
    eval(['qy = q_' sname ';']);
    eval(['ry = r_' sname ';']);
    sy = qy./q_gdp;
    dy = 400*dif(log(ry),1);
    sdy = sy.*dy;
    eval(['s_' sname ' = sy;']);
    eval(['d_' sname ' = dy;']);
    eval(['sd_' sname ' = sdy;']);
end;
s_imports = -s_imports;
sd_imports = -sd_imports;

% Real government expenditures, consumption + transfer payments
q_gov_cons_tp = q_gov_cons + q_gov_transfers;
r_gov_cons_tp = q_gov_cons_tp./p_gdp;
d_gov_cons_tp = 400*dif(log(r_gov_cons_tp),1);
s_gov_cons_tp = NaN(dnobs,1);

