function [ WTL,tao_t,t_0p05_div2,WTLstr ] = pairwise_t_test( A,B,alpha,str_style )
%Description: conduct pairwise-t test between A & B
%Inputs:
%       A - cross-validation result vector of classifier A
%       B - cross-validation result vector of classifier B
%   alpha - significance level (default 0.05)
%Outputs:
%     WTL - '+1' represents A is significantly superior B
%           '-1' represents A is significantly inferior B
%           ' 0' represents A ties B
%   tao_t - Test value
%t_0p05_div2 - critical value according to alpha
    if nargin<4
        str_style{1} = '$\bullet$';%win
        str_style{2} = '         ';%tie
        str_style{3} = '$\circ$  ';%loss
    end
    if nargin<3
        alpha = 0.05;
    end
    numFolds = length(A);
    
    t_0p05_div2 = icdf('T',1-alpha/2,numFolds-1);
    
    delta = A - B;
    mu = mean(delta);
    sigma = std(delta);
    tao_t = abs(sqrt(numFolds)*mu/sigma);
    if tao_t<t_0p05_div2
        WTL = 0;
        WTLstr = str_style{2};
    else
        if mu>0
            WTL = 1;%A is significantly superior to B, i.e., win
            WTLstr = str_style{1};
        elseif mu==0
            WTL = 0;
            WTLstr = str_style{2};
        else
            WTL = -1;%A is significantly inferior to B, i.e., loss
            WTLstr = str_style{3};
        end
    end
end

