% Compute Time Series and Bottom up trend estimates

% (1) Time Series Estimates
% Variable List
ylist = {
  'd_y_prod' ...
  'sd_pce' ...
  'sd_gpdi' ...
  'sd_gov' ...
  'sd_exports' ...
  'sd_imports' ...
  'sd_pce' ...
  'sd_pce_goods' ...
  'sd_pce_services' ...
  'sd_pce_goods' ...
  'sd_pce_goods_dur' ...
  'sd_pce_goods_nondur' ...
  'sd_pce_goods_dur' ...
  'sd_pce_dg_mvp' ...
  'sd_pce_dg_fdhe' ...
  'sd_pce_dg_rgv' ...
  'sd_pce_dg_odg' ...
  'sd_pce_goods_nondur' ... 
  'sd_pce_ng_fb' ...
  'sd_pce_ng_cf' ...
  'sd_pce_ng_ge' ...
  'sd_pce_ng_ong' ...
  'sd_pce_services' ...
  'sd_pce_s_hu' ...
  'sd_pce_s_hc' ...
  'sd_pce_s_ts' ...
  'sd_pce_s_rs' ...
  'sd_pce_s_fsa' ...
  'sd_pce_s_fsi' ...
  'sd_pce_s_os' ...
  'sd_pce_s_npish' ...
  'sd_fpi' ...
  'sd_fpi_nonres' ...
  'sd_fpi_res' ...
  'sd_gpdi_nonres_structures' ...
  'sd_gpdi_nonres_equip' ...
  'sd_gpdi_nonres_ipp' ...
  'sd_gpdi_res_structures' ...
  'sd_gpdi_res_equip' ...
  'sd_gov_fed' ...
  'sd_gov_sl' ...
  'sd_pce_xfe' ...
  'sd_pce_egs' ... 
  'd_gpdi' ...
  'd_fpi' ...
  'd_fpi_nonres' ...
  'd_fpi_res' ...
  'd_gov' ...
  'd_gov_fed' ...
  'd_gov_sl' ...
  'd_pce_xfe' ...
  'd_pce_egs' ...
  'd_pce' ...
  'd_gpdi' ...
  'd_gov' ...
  'd_exports' ...
  'd_imports' ...
  'd_pce' ...
  'd_pce_goods' ...
  'd_pce_services' ...
  'd_pce_goods' ...
  'd_pce_goods_dur' ...
  'd_pce_goods_nondur' ...
  'd_pce_goods_dur' ...
  'd_pce_dg_mvp' ...
  'd_pce_dg_fdhe' ...
  'd_pce_dg_rgv' ...
  'd_pce_dg_odg' ...
  'd_pce_goods_nondur' ... 
  'd_pce_ng_fb' ...
  'd_pce_ng_cf' ...
  'd_pce_ng_ge' ...
  'd_pce_ng_ong' ...
  'd_pce_services' ...
  'd_pce_s_hu' ...
  'd_pce_s_hc' ...
  'd_pce_s_ts' ...
  'd_pce_s_rs' ...
  'd_pce_s_fsa' ...
  'd_pce_s_fsi' ...
  'd_pce_s_os' ...
  'd_pce_s_npish' ...
  'd_gpdi_nonres_structures' ...
  'd_gpdi_nonres_equip' ...
  'd_gpdi_nonres_ipp' ...
  'd_gpdi_res_structures' ...
  'd_gpdi_res_equip' ...
  'd_gov_fed' ...
  'd_gov_sl' ...
  'd_pce_xfe' ...
  'd_pce_egs' ... 
  'd_gov_cons_tp' ...
};

for iseries = 1:size(ylist,2);
  sname = char(ylist(iseries));
  eval_str = ['dz = ' sname ';'];
  eval(eval_str);
  [dz_mu] = mu_ca(dz,xca,ismpl_ol,bw_bw);
  eval_str = [sname '_mu = dz_mu;'];
  eval(eval_str);
     
end;

% Forecasts .. extrapolative

for iseries = 1:size(ylist,2);
  sname = char(ylist(iseries));
  eval_str = ['dz_mu = ' sname '_mu;'];
  eval(eval_str);
  dz_mu_fcst = dz_mu;
  dz_mu_fcst(iT_fcst+1:end) = dz_mu(iT_fcst);
  eval_str = [sname '_mu_fcst = dz_mu_fcst;'];
  eval(eval_str);
end;


