%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%   ScaleProfiles_S
%-------------------------------------
%   This function normalizes profiles in the following way:
%       Consumption and Labor income are normalized by the average over
%       ages 30-49
%       Transfer profiles are normalized so that the Fiscal support ration
%       in year 2010 is equal to 1
function [c, yl, tgi, tgo] = ScaleProfiles_S(c_prof, yl_prof, tgi_prof, tgo_prof, popul)

scale_y = mean(yl_prof(31:50));
yl = yl_prof/scale_y;
scale_c = mean(c_prof(31:50));
c = c_prof/scale_c;
if isfinite(tgi_prof(1))
    tgi = tgi_prof / sum(popul .* tgi_prof);
    tgo = tgo_prof / sum(popul .* tgo_prof);
else
    tgi = tgi_prof;
    tgo = tgo_prof;
end
