function F=SMM_CCL_skew_revision2(paramvec)

save('paramvec','paramvec');

dynare Skewness_runmodel noclearall
DynamicSimulation_estimation;

load 'vv';

covar=var(vv); 

acf_gdp=autocorr(vv(:,1),1); acf_cons=autocorr(vv(:,2),1); acf_inv=autocorr(vv(:,3),1); acf_house=autocorr(vv(:,4),1); acf_ltv=autocorr(vv(:,5),1);
conta=1; for jj=2:4; correl(conta)=corr(vv(:,1),vv(:,jj)); conta=conta+1; end 
skew=skewness(vv(:,1:3)); 

% Collect the moments 
finalmoments=[covar(1:5) acf_gdp(2) acf_cons(2) acf_inv(2) acf_house(2) acf_ltv(2) correl skew ]';

save('finalmoments_revision','finalmoments');

load finaldatamoments_final; 

moments = [  ((100*(finalmoments(1:5,1).^.5)-100*(finaldatamoments(1:5,1).^.5))./(100*(finaldatamoments(1:5,1).^.5)));
             finalmoments(6:16,1)-finaldatamoments(6:16,1)     ];

         
nmom=length(moments);
weights=eye(nmom);
weights(1,1)=2.5; weights(14,14)=2.5;  weights(15,15)=2.5;  weights(16,16)=2.5;

F=moments'*weights*moments;
save('F','F');