function [e1, e2, e3, eMax, eMin] = estimatedError(predictionError, index, row)
    error = predictionError(index);
    errorMin = sort(error, 'descend');
    errorMax = sort(error);
    
    if(mod(length(index),2)==0)
        errorMin = [ errorMin(2:end) errorMin(end)];
        errorMax = [ errorMax(2:end) errorMax(end)];
    end
    
    for i=1 : length(index)
        if(errorMin(i) == 0)
            errorMin(i) = 1/row;
        end
        if(errorMax(i) == 0)
            errorMax(i) = 1/row;
        end        
    end
    
    eMax = errorMax(1);
    eMin = 1/errorMin(1);
    for i=2 : length(index)
        eMax = eMax + 2^(i-2)*errorMax(i);
        eMin = eMin + 2^(i-2)/errorMin(i);
    end
    eMax = eMax / (2^(length(index)-1));
    eMin = (2^(length(index)-1)) / eMin;
    
    e1 = mean([eMax; eMin]);
    e2 = geomean([eMax; eMin]);
    e3 = harmmean([eMax; eMin]);
end