                
                % ESTIMATE WITH KERNEL BASED ESTIMATOR
                tic
                temp_kern        = VAR_estimate_kernel_6(ydata,m,d1,kernshape,burn,obs-hmax,phi_grid_kernel,H_grid,length(phi_grid_kernel),H_gridsize,hmax,NN_VAR,lags,0);                
                toc
                for jj=1:length(kernshape)
                    kern_dma1.(kernshape{jj})(:,(kk-1)*m+1:kk*m)=temp_kern.(kernshape{jj}).errors_ave1;
                    kern_dma2.(kernshape{jj})(:,(kk-1)*m+1:kk*m)=temp_kern.(kernshape{jj}).errors_ave2;
                    kern_dms.(kernshape{jj})(:,(kk-1)*m+1:kk*m)=temp_kern.(kernshape{jj}).errors_sel;
                end

                % DIFFERENCED DATA TO BE USED IN THE KOOP/KOROBILIS ESTIMATOR
                ydata_D = ydata-[ydata(1,:);ydata(1:end-1,:)];
                OUT_KK  =     VAR_estimate_KK_3(ydata_D,ydata,m,zeros(m^2+m*const,1),V_i,burn,obs-hmax,length(phi_grid_KK),hmax,NN_VAR,lags,const);
                KK_dma(:,(kk-1)*m+1:kk*m)=OUT_KK.errors_dma;
                KK_dms(:,(kk-1)*m+1:kk*m)=OUT_KK.errors_dms;
                KK_dma(:,(kk-1)*m+1:kk*m)=OUT_KK.errors_dma;
                KK_dms(:,(kk-1)*m+1:kk*m)=OUT_KK.errors_dms;