        clear; clc; close all;
        
curpath = pwd;
addpath(genpath(curpath));
path_read = [curpath,'\Out_Mcarlo\'];
mkdir(path_read)
dirout    = path_read;

DGPs = {'DGP1','DGP2','DGP2bis','DGP3'};

        count    = 0;
        count_m  = 0;
        for dgp=1:length(DGPs)           
            for m = [7 15]
                count_m = count_m+1;
                for T   = [100 150 200]
                    if T==100
                        span = 1:50;
                    elseif T==150
                        span = 26:100;
                    elseif T==200
                        span= 51:150;
                    end
                    if dgp==1
                        filename=([path_read,DGPs{dgp},'_m_',num2str(m),'_T_200_thetalow_0.85.mat']);
                    elseif dgp==2
                        filename=([path_read,DGPs{dgp},'_m_',num2str(m),'_T_200_thetalow_0.mat']);
                    elseif dgp==3
                        filename=([path_read,DGPs{dgp},'_m_',num2str(m),'_T_200_thetalow_0.mat']);
                    elseif dgp==4
                        filename=([path_read,DGPs{dgp},'_m_',num2str(m),'_T_200_thetalow_-0.999.mat']);
                    end
                    load(filename)
                    disp(filename)
                    count  = count+1;
                    %                   Parametric estimator
                    T_mcarlo(count,1) = mean(sqrt(mean((KK_dma(span,:)).^2)));
                    T_mcarlo(count,2) = mean(sqrt(mean((kern_dma1.gauss(span,:)).^2)));
                    T_mcarlo(count,3) = mean(sqrt(mean((kern_dma2.gauss(span,:)).^2)));
                    T_mcarlo_rel(count,1:3) = T_mcarlo(count,1:3)./T_mcarlo(count,1);
                    clear kern* KK*
                end
                T_mcarlo_rel     = [T_mcarlo_rel;NaN(1,3)]; 
%                 T_mcarlo         = [T_mcarlo;NaN(1,6)];
%                 T_mcarlo_rel     = [T_mcarlo_rel;NaN(1,6)];                
%                 %            count = count+1;
            end
        end
disp(T_mcarlo_rel)