function [lin_nonlin_inf]=lin_inf_nonlin(var_values_nonlin)


xip=0.667;
betta=0.995;
thetap=0.1;
psie=-12.2;
kappamc=(1-xip)*(1-xip*betta)/xip/(1-(1+thetap)*psie);

for ind=1:length(var_values_nonlin)

data = var_values_nonlin{ind,1};
ss_mc=data(14,1);
  mc_nonlin = (data(14,2:end)-ss_mc)/ss_mc;






inf_est = zeros(length(mc_nonlin),1);
for i = 1:21
    for j =0:length(mc_nonlin)-i
    inf_est(i) = inf_est(i)+kappamc*(betta^j)*mc_nonlin(i+j);
    end
end
inf2=(1+inf_est)*1.005;
inf_nonlin = inf2;
% for k = (1:21);
%                     inf_nonlin(1) = 0.25*(2 + 2 + 2 + inf2(1));
%                     inf_nonlin(2) = 0.25*(2 + 2 + inf2(1) + inf2(2));             
%                     inf_nonlin(3) = 0.25*(2 + inf2(1) + inf2(2) + inf2(3));
%                     if k>3,
%                      inf_nonlin(k) = 0.25*(inf2(k-3) + inf2(k-2) + inf2(k-1) + inf2(k));
%                     end;
% end;
lin_nonlin_inf{ind,1}=[1.005,inf_nonlin(1:end)'];
end
end


