Type of probability distribution
In statistics , particularly in hypothesis testing , the Hotelling's T -squared distribution  (T 2 Harold Hotelling ,[ 1] multivariate probability distribution  that is tightly related to the F -distributionsample statistics  that are natural generalizations of the statistics underlying the Student's t -distribution .
The Hotelling's t -squared statistic  (t 2 Student's t -statistic  that is used in multivariate  hypothesis testing .[ 2] 
The distribution arises in multivariate statistics  in undertaking tests  of the differences between the (multivariate) means of different populations, where tests for univariate problems would make use of a t -testHarold Hotelling , who developed it as a generalization of Student's t -distribution.[ 1] 
If the vector  
  
    
      
        d 
       
     
    {\displaystyle d} 
   
 Gaussian multivariate-distributed  with zero mean and unit covariance matrix   
  
    
      
        N 
        ( 
        
          
            0 
           
          
            p 
           
         
        , 
        
          
            I 
           
          
            p 
            , 
            p 
           
         
        ) 
       
     
    {\displaystyle N(\mathbf {0} _{p},\mathbf {I} _{p,p})} 
   
 
  
    
      
        M 
       
     
    {\displaystyle M} 
   
 
  
    
      
        p 
        × 
        p 
       
     
    {\displaystyle p\times p} 
   
 Wishart distribution  
  
    
      
        W 
        ( 
        
          
            I 
           
          
            p 
            , 
            p 
           
         
        , 
        m 
        ) 
       
     
    {\displaystyle W(\mathbf {I} _{p,p},m)} 
   
 scale matrix  and m  degrees of freedom , and d  and M  are independent of each other, then the quadratic form  
  
    
      
        X 
       
     
    {\displaystyle X} 
   
 
  
    
      
        p 
       
     
    {\displaystyle p} 
   
 
  
    
      
        m 
       
     
    {\displaystyle m} 
   
 [ 3] 
  
    
      
        X 
        = 
        m 
        
          d 
          
            T 
           
         
        
          M 
          
            − 
            1 
           
         
        d 
        ∼ 
        
          T 
          
            2 
           
         
        ( 
        p 
        , 
        m 
        ) 
        . 
       
     
    {\displaystyle X=md^{T}M^{-1}d\sim T^{2}(p,m).} 
   
 
It can be shown that if a random variable X  has Hotelling's T -squared distribution, 
  
    
      
        X 
        ∼ 
        
          T 
          
            p 
            , 
            m 
           
          
            2 
           
         
       
     
    {\displaystyle X\sim T_{p,m}^{2}} 
   
 [ 1] 
  
    
      
        
          
            
              m 
              − 
              p 
              + 
              1 
             
            
              p 
              m 
             
           
         
        X 
        ∼ 
        
          F 
          
            p 
            , 
            m 
            − 
            p 
            + 
            1 
           
         
       
     
    {\displaystyle {\frac {m-p+1}{pm}}X\sim F_{p,m-p+1}} 
   
 
  
    
      
        
          F 
          
            p 
            , 
            m 
            − 
            p 
            + 
            1 
           
         
       
     
    {\displaystyle F_{p,m-p+1}} 
   
 F -distributionp  and m  − p  + 1.
Hotelling t -squared statistic [ edit ] Let 
  
    
      
        
          
            
              
                Σ 
               
              ^ 
             
           
         
       
     
    {\displaystyle {\hat {\mathbf {\Sigma } }}} 
   
 sample covariance :
  
    
      
        
          
            
              
                Σ 
               
              ^ 
             
           
         
        = 
        
          
            1 
            
              n 
              − 
              1 
             
           
         
        
          ∑ 
          
            i 
            = 
            1 
           
          
            n 
           
         
        
          ( 
          
            
              
                x 
               
              
                i 
               
             
            − 
            
              
                
                  x 
                 
                ¯ 
               
             
           
          ) 
         
        
          
            ( 
            
              
                
                  x 
                 
                
                  i 
                 
               
              − 
              
                
                  
                    x 
                   
                  ¯ 
                 
               
             
            ) 
           
          ′ 
         
       
     
    {\displaystyle {\hat {\mathbf {\Sigma } }}={\frac {1}{n-1}}\sum _{i=1}^{n}\left(\mathbf {x} _{i}-{\overline {\mathbf {x} }}\right)\left(\mathbf {x} _{i}-{\overline {\mathbf {x} }}\right)'} 
   
 
where we denote transpose  by an apostrophe . It can be shown that 
  
    
      
        
          
            
              
                Σ 
               
              ^ 
             
           
         
       
     
    {\displaystyle {\hat {\mathbf {\Sigma } }}} 
   
 positive (semi) definite  matrix and 
  
    
      
        ( 
        n 
        − 
        1 
        ) 
        
          
            
              
                Σ 
               
              ^ 
             
           
         
       
     
    {\displaystyle (n-1){\hat {\mathbf {\Sigma } }}} 
   
 p -variate Wishart distribution  with n  − 1 degrees of freedom.[ 4] 
  
    
      
        
          
            
              
                
                  Σ 
                 
                ^ 
               
             
           
          
            
              
                x 
               
              ¯ 
             
           
         
        = 
        
          
            
              
                Σ 
               
              ^ 
             
           
         
        
          / 
         
        n 
       
     
    {\displaystyle {\hat {\mathbf {\Sigma } }}_{\overline {\mathbf {x} }}={\hat {\mathbf {\Sigma } }}/n} 
   
 [ 5] 
The Hotelling's t -squared statistic  is then defined as:[ 6] 
  
    
      
        
          t 
          
            2 
           
         
        = 
        ( 
        
          
            
              x 
             
            ¯ 
           
         
        − 
        
          μ 
         
        
          ) 
          ′ 
         
        
          
            
              
                
                  Σ 
                 
                ^ 
               
             
           
          
            
              
                x 
               
              ¯ 
             
           
          
            − 
            1 
           
         
        ( 
        
          
            
              x 
             
            ¯ 
           
         
        − 
        
          
            μ 
           
         
        ) 
        = 
        n 
        ( 
        
          
            
              x 
             
            ¯ 
           
         
        − 
        
          μ 
         
        
          ) 
          ′ 
         
        
          
            
              
                
                  Σ 
                 
                ^ 
               
             
           
          
            − 
            1 
           
         
        ( 
        
          
            
              x 
             
            ¯ 
           
         
        − 
        
          
            μ 
           
         
        ) 
        , 
       
     
    {\displaystyle t^{2}=({\overline {\mathbf {x} }}-{\boldsymbol {\mu }})'{\hat {\mathbf {\Sigma } }}_{\overline {\mathbf {x} }}^{-1}({\overline {\mathbf {x} }}-{\boldsymbol {\mathbf {\mu } }})=n({\overline {\mathbf {x} }}-{\boldsymbol {\mu }})'{\hat {\mathbf {\Sigma } }}^{-1}({\overline {\mathbf {x} }}-{\boldsymbol {\mathbf {\mu } }}),} 
   
 
which is proportional to the Mahalanobis distance  between the sample mean and 
  
    
      
        
          μ 
         
       
     
    {\displaystyle {\boldsymbol {\mu }}} 
   
 
  
    
      
        
          
            
              x 
             
            ¯ 
           
         
        ≈ 
        
          μ 
         
       
     
    {\displaystyle {\overline {\mathbf {x} }}\approx {\boldsymbol {\mu }}} 
   
 
From the distribution ,
  
    
      
        
          t 
          
            2 
           
         
        ∼ 
        
          T 
          
            p 
            , 
            n 
            − 
            1 
           
          
            2 
           
         
        = 
        
          
            
              p 
              ( 
              n 
              − 
              1 
              ) 
             
            
              n 
              − 
              p 
             
           
         
        
          F 
          
            p 
            , 
            n 
            − 
            p 
           
         
        , 
       
     
    {\displaystyle t^{2}\sim T_{p,n-1}^{2}={\frac {p(n-1)}{n-p}}F_{p,n-p},} 
   
 
where 
  
    
      
        
          F 
          
            p 
            , 
            n 
            − 
            p 
           
         
       
     
    {\displaystyle F_{p,n-p}} 
   
 F -distributionp  and n  − p . 
In order to calculate a p -valuep  variable here), note that the distribution of 
  
    
      
        
          t 
          
            2 
           
         
       
     
    {\displaystyle t^{2}} 
   
 
  
    
      
        
          
            
              n 
              − 
              p 
             
            
              p 
              ( 
              n 
              − 
              1 
              ) 
             
           
         
        
          t 
          
            2 
           
         
        ∼ 
        
          F 
          
            p 
            , 
            n 
            − 
            p 
           
         
        . 
       
     
    {\displaystyle {\frac {n-p}{p(n-1)}}t^{2}\sim F_{p,n-p}.} 
   
 
Then, use the quantity on the left hand side to evaluate the p -value corresponding to the sample, which comes from the F -distribution. A confidence region  may also be determined using similar logic.
Let 
  
    
      
        
          
            
              N 
             
           
          
            p 
           
         
        ( 
        
          μ 
         
        , 
        
          
            Σ 
           
         
        ) 
       
     
    {\displaystyle {\mathcal {N}}_{p}({\boldsymbol {\mu }},{\mathbf {\Sigma } })} 
   
 p -variate normal distributionlocation  
  
    
      
        
          μ 
         
       
     
    {\displaystyle {\boldsymbol {\mu }}} 
   
 covariance  
  
    
      
        
          
            Σ 
           
         
       
     
    {\displaystyle {\mathbf {\Sigma } }} 
   
 
  
    
      
        
          
            
              x 
             
           
          
            1 
           
         
        , 
        … 
        , 
        
          
            
              x 
             
           
          
            n 
           
         
        ∼ 
        
          
            
              N 
             
           
          
            p 
           
         
        ( 
        
          μ 
         
        , 
        
          
            Σ 
           
         
        ) 
       
     
    {\displaystyle {\mathbf {x} }_{1},\dots ,{\mathbf {x} }_{n}\sim {\mathcal {N}}_{p}({\boldsymbol {\mu }},{\mathbf {\Sigma } })} 
   
 
be n  independent identically distributed (iid) random variables , which may be represented as 
  
    
      
        p 
        × 
        1 
       
     
    {\displaystyle p\times 1} 
   
 
  
    
      
        
          
            
              x 
             
            ¯ 
           
         
        = 
        
          
            
              
                
                  x 
                 
                
                  1 
                 
               
              + 
              ⋯ 
              + 
              
                
                  x 
                 
                
                  n 
                 
               
             
            n 
           
         
       
     
    {\displaystyle {\overline {\mathbf {x} }}={\frac {\mathbf {x} _{1}+\cdots +\mathbf {x} _{n}}{n}}} 
   
 
to be the sample mean  with covariance 
  
    
      
        
          
            
              Σ 
             
           
          
            
              
                x 
               
              ¯ 
             
           
         
        = 
        
          
            Σ 
           
         
        
          / 
         
        n 
       
     
    {\displaystyle {\mathbf {\Sigma } }_{\overline {\mathbf {x} }}={\mathbf {\Sigma } }/n} 
   
 
  
    
      
        ( 
        
          
            
              x 
             
            ¯ 
           
         
        − 
        
          μ 
         
        
          ) 
          ′ 
         
        
          
            
              Σ 
             
           
          
            
              
                x 
               
              ¯ 
             
           
          
            − 
            1 
           
         
        ( 
        
          
            
              x 
             
            ¯ 
           
         
        − 
        
          
            μ 
           
         
        ) 
        ∼ 
        
          χ 
          
            p 
           
          
            2 
           
         
        , 
       
     
    {\displaystyle ({\overline {\mathbf {x} }}-{\boldsymbol {\mu }})'{\mathbf {\Sigma } }_{\overline {\mathbf {x} }}^{-1}({\overline {\mathbf {x} }}-{\boldsymbol {\mathbf {\mu } }})\sim \chi _{p}^{2},} 
   
 
where 
  
    
      
        
          χ 
          
            p 
           
          
            2 
           
         
       
     
    {\displaystyle \chi _{p}^{2}} 
   
 chi-squared distribution  with p  degrees of freedom.[ 7] 
Alternatively, one can argue using density functions and characteristic functions, as follows.
Proof
 
Proof 
To show this use the fact that 
  
    
      
        
          
            
              x 
             
            ¯ 
           
         
        ∼ 
        
          
            
              N 
             
           
          
            p 
           
         
        ( 
        
          μ 
         
        , 
        
          
            Σ 
           
         
        
          / 
         
        n 
        ) 
       
     
    {\displaystyle {\overline {\mathbf {x} }}\sim {\mathcal {N}}_{p}({\boldsymbol {\mu }},{\mathbf {\Sigma } }/n)} 
   
 characteristic function  of the random variable 
  
    
      
        
          y 
         
        = 
        ( 
        
          
            
              
                x 
               
              ¯ 
             
           
         
        − 
        
          μ 
         
        
          ) 
          ′ 
         
        
          
            
              Σ 
             
           
          
            
              
                
                  x 
                 
                ¯ 
               
             
           
          
            − 
            1 
           
         
        ( 
        
          
            
              
                x 
               
              ¯ 
             
           
         
        − 
        
          
            μ 
           
         
        ) 
        = 
        ( 
        
          
            
              
                x 
               
              ¯ 
             
           
         
        − 
        
          μ 
         
        
          ) 
          ′ 
         
        ( 
        
          
            Σ 
           
         
        
          / 
         
        n 
        
          ) 
          
            − 
            1 
           
         
        ( 
        
          
            
              
                x 
               
              ¯ 
             
           
         
        − 
        
          
            μ 
           
         
        ) 
       
     
    {\displaystyle \mathbf {y} =({\bar {\mathbf {x} }}-{\boldsymbol {\mu }})'{\mathbf {\Sigma } }_{\bar {\mathbf {x} }}^{-1}({\bar {\mathbf {x} }}-{\boldsymbol {\mathbf {\mu } }})=({\bar {\mathbf {x} }}-{\boldsymbol {\mu }})'({\mathbf {\Sigma } }/n)^{-1}({\bar {\mathbf {x} }}-{\boldsymbol {\mathbf {\mu } }})} 
   
 
  
    
      
        
          | 
         
        ⋅ 
        
          | 
         
       
     
    {\displaystyle |\cdot |} 
   
 determinant  of the argument, as in 
  
    
      
        
          | 
         
        
          Σ 
         
        
          | 
         
       
     
    {\displaystyle |{\boldsymbol {\Sigma }}|} 
   
 
By definition of characteristic function, we have:[ 8] 
  
    
      
        
          
            
              
                
                  φ 
                  
                    
                      y 
                     
                   
                 
                ( 
                θ 
                ) 
               
              
                = 
                E 
                 
                
                  e 
                  
                    i 
                    θ 
                    
                      y 
                     
                   
                 
                , 
               
             
            
              
                = 
                E 
                 
                
                  e 
                  
                    i 
                    θ 
                    ( 
                    
                      
                        
                          x 
                         
                        ¯ 
                       
                     
                    − 
                    
                      μ 
                     
                    
                      ) 
                      ′ 
                     
                    ( 
                    
                      
                        Σ 
                       
                     
                    
                      / 
                     
                    n 
                    
                      ) 
                      
                        − 
                        1 
                       
                     
                    ( 
                    
                      
                        
                          x 
                         
                        ¯ 
                       
                     
                    − 
                    
                      
                        μ 
                       
                     
                    ) 
                   
                 
               
             
            
              
                = 
                ∫ 
                
                  e 
                  
                    i 
                    θ 
                    ( 
                    
                      
                        
                          x 
                         
                        ¯ 
                       
                     
                    − 
                    
                      μ 
                     
                    
                      ) 
                      ′ 
                     
                    n 
                    
                      
                        
                          Σ 
                         
                       
                      
                        − 
                        1 
                       
                     
                    ( 
                    
                      
                        
                          x 
                         
                        ¯ 
                       
                     
                    − 
                    
                      
                        μ 
                       
                     
                    ) 
                   
                 
                ( 
                2 
                π 
                
                  ) 
                  
                    − 
                    p 
                    
                      / 
                     
                    2 
                   
                 
                
                  | 
                 
                
                  Σ 
                 
                
                  / 
                 
                n 
                
                  
                    | 
                   
                  
                    − 
                    1 
                    
                      / 
                     
                    2 
                   
                 
                
                  e 
                  
                    − 
                    ( 
                    1 
                    
                      / 
                     
                    2 
                    ) 
                    ( 
                    
                      
                        
                          x 
                         
                        ¯ 
                       
                     
                    − 
                    
                      μ 
                     
                    
                      ) 
                      ′ 
                     
                    n 
                    
                      
                        Σ 
                       
                      
                        − 
                        1 
                       
                     
                    ( 
                    
                      
                        
                          x 
                         
                        ¯ 
                       
                     
                    − 
                    
                      μ 
                     
                    ) 
                   
                 
                d 
                
                  x 
                  
                    1 
                   
                 
                ⋯ 
                d 
                
                  x 
                  
                    p 
                   
                 
               
             
           
         
       
     
    {\displaystyle {\begin{aligned}\varphi _{\mathbf {y} }(\theta )&=\operatorname {E} e^{i\theta \mathbf {y} },\\[5pt]&=\operatorname {E} e^{i\theta ({\overline {\mathbf {x} }}-{\boldsymbol {\mu }})'({\mathbf {\Sigma } }/n)^{-1}({\overline {\mathbf {x} }}-{\boldsymbol {\mathbf {\mu } }})}\\[5pt]&=\int e^{i\theta ({\overline {\mathbf {x} }}-{\boldsymbol {\mu }})'n{\mathbf {\Sigma } }^{-1}({\overline {\mathbf {x} }}-{\boldsymbol {\mathbf {\mu } }})}(2\pi )^{-p/2}|{\boldsymbol {\Sigma }}/n|^{-1/2}\,e^{-(1/2)({\overline {\mathbf {x} }}-{\boldsymbol {\mu }})'n{\boldsymbol {\Sigma }}^{-1}({\overline {\mathbf {x} }}-{\boldsymbol {\mu }})}\,dx_{1}\cdots dx_{p}\end{aligned}}} 
   
 
  
    
      
        
          
            
              
                = 
                ∫ 
                ( 
                2 
                π 
                
                  ) 
                  
                    − 
                    p 
                    
                      / 
                     
                    2 
                   
                 
                
                  | 
                 
                
                  Σ 
                 
                
                  / 
                 
                n 
                
                  
                    | 
                   
                  
                    − 
                    1 
                    
                      / 
                     
                    2 
                   
                 
                
                  e 
                  
                    − 
                    ( 
                    1 
                    
                      / 
                     
                    2 
                    ) 
                    ( 
                    
                      
                        
                          x 
                         
                        ¯ 
                       
                     
                    − 
                    
                      μ 
                     
                    
                      ) 
                      ′ 
                     
                    n 
                    ( 
                    
                      
                        Σ 
                       
                      
                        − 
                        1 
                       
                     
                    − 
                    2 
                    i 
                    θ 
                    
                      
                        Σ 
                       
                      
                        − 
                        1 
                       
                     
                    ) 
                    ( 
                    
                      
                        
                          x 
                         
                        ¯ 
                       
                     
                    − 
                    
                      μ 
                     
                    ) 
                   
                 
                d 
                
                  x 
                  
                    1 
                   
                 
                ⋯ 
                d 
                
                  x 
                  
                    p 
                   
                 
               
             
           
         
       
     
    {\displaystyle {\begin{aligned}&=\int (2\pi )^{-p/2}|{\boldsymbol {\Sigma }}/n|^{-1/2}\,e^{-(1/2)({\overline {\mathbf {x} }}-{\boldsymbol {\mu }})'n({\boldsymbol {\Sigma }}^{-1}-2i\theta {\boldsymbol {\Sigma }}^{-1})({\overline {\mathbf {x} }}-{\boldsymbol {\mu }})}\,dx_{1}\cdots dx_{p}\end{aligned}}} 
   
 
  
    
      
        
          | 
         
        
          Σ 
         
        
          / 
         
        n 
        
          
            | 
           
          
            − 
            1 
            
              / 
             
            2 
           
         
       
     
    {\displaystyle |{\boldsymbol {\Sigma }}/n|^{-1/2}} 
   
 
  
    
      
        I 
        = 
        
          | 
         
        ( 
        
          
            Σ 
           
          
            − 
            1 
           
         
        − 
        2 
        i 
        θ 
        
          
            Σ 
           
          
            − 
            1 
           
         
        
          ) 
          
            − 
            1 
           
         
        
          / 
         
        n 
        
          
            | 
           
          
            1 
            
              / 
             
            2 
           
         
        ⋅ 
        
          | 
         
        ( 
        
          
            Σ 
           
          
            − 
            1 
           
         
        − 
        2 
        i 
        θ 
        
          
            Σ 
           
          
            − 
            1 
           
         
        
          ) 
          
            − 
            1 
           
         
        
          / 
         
        n 
        
          
            | 
           
          
            − 
            1 
            
              / 
             
            2 
           
         
       
     
    {\displaystyle I=|({\boldsymbol {\Sigma }}^{-1}-2i\theta {\boldsymbol {\Sigma }}^{-1})^{-1}/n|^{1/2}\;\cdot \;|({\boldsymbol {\Sigma }}^{-1}-2i\theta {\boldsymbol {\Sigma }}^{-1})^{-1}/n|^{-1/2}} 
   
 
  
    
      
        
          
            
              
                = 
                
                  | 
                 
                ( 
                
                  
                    Σ 
                   
                  
                    − 
                    1 
                   
                 
                − 
                2 
                i 
                θ 
                
                  
                    Σ 
                   
                  
                    − 
                    1 
                   
                 
                
                  ) 
                  
                    − 
                    1 
                   
                 
                
                  / 
                 
                n 
                
                  
                    | 
                   
                  
                    1 
                    
                      / 
                     
                    2 
                   
                 
                
                  | 
                 
                
                  Σ 
                 
                
                  / 
                 
                n 
                
                  
                    | 
                   
                  
                    − 
                    1 
                    
                      / 
                     
                    2 
                   
                 
                ∫ 
                ( 
                2 
                π 
                
                  ) 
                  
                    − 
                    p 
                    
                      / 
                     
                    2 
                   
                 
                
                  | 
                 
                ( 
                
                  
                    Σ 
                   
                  
                    − 
                    1 
                   
                 
                − 
                2 
                i 
                θ 
                
                  
                    Σ 
                   
                  
                    − 
                    1 
                   
                 
                
                  ) 
                  
                    − 
                    1 
                   
                 
                
                  / 
                 
                n 
                
                  
                    | 
                   
                  
                    − 
                    1 
                    
                      / 
                     
                    2 
                   
                 
                
                  e 
                  
                    − 
                    ( 
                    1 
                    
                      / 
                     
                    2 
                    ) 
                    n 
                    ( 
                    
                      
                        
                          x 
                         
                        ¯ 
                       
                     
                    − 
                    
                      μ 
                     
                    
                      ) 
                      ′ 
                     
                    ( 
                    
                      
                        Σ 
                       
                      
                        − 
                        1 
                       
                     
                    − 
                    2 
                    i 
                    θ 
                    
                      
                        Σ 
                       
                      
                        − 
                        1 
                       
                     
                    ) 
                    ( 
                    
                      
                        
                          x 
                         
                        ¯ 
                       
                     
                    − 
                    
                      μ 
                     
                    ) 
                   
                 
                d 
                
                  x 
                  
                    1 
                   
                 
                ⋯ 
                d 
                
                  x 
                  
                    p 
                   
                 
               
             
           
         
       
     
    {\displaystyle {\begin{aligned}&=|({\boldsymbol {\Sigma }}^{-1}-2i\theta {\boldsymbol {\Sigma }}^{-1})^{-1}/n|^{1/2}|{\boldsymbol {\Sigma }}/n|^{-1/2}\int (2\pi )^{-p/2}|({\boldsymbol {\Sigma }}^{-1}-2i\theta {\boldsymbol {\Sigma }}^{-1})^{-1}/n|^{-1/2}\,e^{-(1/2)n({\overline {\mathbf {x} }}-{\boldsymbol {\mu }})'({\boldsymbol {\Sigma }}^{-1}-2i\theta {\boldsymbol {\Sigma }}^{-1})({\overline {\mathbf {x} }}-{\boldsymbol {\mu }})}\,dx_{1}\cdots dx_{p}\end{aligned}}} 
   
 multivariate normal distribution  with covariance matrix 
  
    
      
        ( 
        
          
            Σ 
           
          
            − 
            1 
           
         
        − 
        2 
        i 
        θ 
        
          
            Σ 
           
          
            − 
            1 
           
         
        
          ) 
          
            − 
            1 
           
         
        
          / 
         
        n 
        = 
        
          
            [ 
            
              n 
              ( 
              
                
                  Σ 
                 
                
                  − 
                  1 
                 
               
              − 
              2 
              i 
              θ 
              
                
                  Σ 
                 
                
                  − 
                  1 
                 
               
              ) 
             
            ] 
           
          
            − 
            1 
           
         
       
     
    {\displaystyle ({\boldsymbol {\Sigma }}^{-1}-2i\theta {\boldsymbol {\Sigma }}^{-1})^{-1}/n=\left[n({\boldsymbol {\Sigma }}^{-1}-2i\theta {\boldsymbol {\Sigma }}^{-1})\right]^{-1}} 
   
 
  
    
      
        μ 
       
     
    {\displaystyle \mu } 
   
 
  
    
      
        
          x 
          
            1 
           
         
        , 
        … 
        , 
        
          x 
          
            p 
           
         
       
     
    {\displaystyle x_{1},\dots ,x_{p}} 
   
 
  
    
      
        1 
       
     
    {\displaystyle 1} 
   
 probability axioms .[clarification needed   We thus end up with:
  
    
      
        
          
            
              
                = 
                
                  
                    | 
                    
                      ( 
                      
                        
                          Σ 
                         
                        
                          − 
                          1 
                         
                       
                      − 
                      2 
                      i 
                      θ 
                      
                        
                          Σ 
                         
                        
                          − 
                          1 
                         
                       
                      
                        ) 
                        
                          − 
                          1 
                         
                       
                      ⋅ 
                      
                        
                          1 
                          n 
                         
                       
                     
                    | 
                   
                  
                    1 
                    
                      / 
                     
                    2 
                   
                 
                
                  | 
                 
                
                  Σ 
                 
                
                  / 
                 
                n 
                
                  
                    | 
                   
                  
                    − 
                    1 
                    
                      / 
                     
                    2 
                   
                 
               
             
            
              
                = 
                
                  
                    | 
                    
                      ( 
                      
                        
                          Σ 
                         
                        
                          − 
                          1 
                         
                       
                      − 
                      2 
                      i 
                      θ 
                      
                        
                          Σ 
                         
                        
                          − 
                          1 
                         
                       
                      
                        ) 
                        
                          − 
                          1 
                         
                       
                      ⋅ 
                      
                        
                          1 
                          
                            n 
                           
                         
                       
                      ⋅ 
                      
                        
                          n 
                         
                       
                      ⋅ 
                      
                        
                          Σ 
                         
                        
                          − 
                          1 
                         
                       
                     
                    | 
                   
                  
                    1 
                    
                      / 
                     
                    2 
                   
                 
               
             
            
              
                = 
                
                  
                    | 
                    
                      
                        [ 
                        
                          ( 
                          
                            
                              
                                
                                  Σ 
                                 
                                
                                  − 
                                  1 
                                 
                               
                             
                           
                          − 
                          2 
                          i 
                          θ 
                          
                            
                              
                                
                                  Σ 
                                 
                                
                                  − 
                                  1 
                                 
                               
                             
                           
                          ) 
                          
                            
                              Σ 
                             
                           
                         
                        ] 
                       
                      
                        − 
                        1 
                       
                     
                    | 
                   
                  
                    1 
                    
                      / 
                     
                    2 
                   
                 
               
             
            
              
                = 
                
                  | 
                 
                
                  
                    I 
                   
                  
                    p 
                   
                 
                − 
                2 
                i 
                θ 
                
                  
                    I 
                   
                  
                    p 
                   
                 
                
                  
                    | 
                   
                  
                    − 
                    1 
                    
                      / 
                     
                    2 
                   
                 
               
             
           
         
       
     
    {\displaystyle {\begin{aligned}&=\left|({\boldsymbol {\Sigma }}^{-1}-2i\theta {\boldsymbol {\Sigma }}^{-1})^{-1}\cdot {\frac {1}{n}}\right|^{1/2}|{\boldsymbol {\Sigma }}/n|^{-1/2}\\&=\left|({\boldsymbol {\Sigma }}^{-1}-2i\theta {\boldsymbol {\Sigma }}^{-1})^{-1}\cdot {\frac {1}{\cancel {n}}}\cdot {\cancel {n}}\cdot {\boldsymbol {\Sigma }}^{-1}\right|^{1/2}\\&=\left|\left[({\cancel {{\boldsymbol {\Sigma }}^{-1}}}-2i\theta {\cancel {{\boldsymbol {\Sigma }}^{-1}}}){\cancel {\boldsymbol {\Sigma }}}\right]^{-1}\right|^{1/2}\\&=|\mathbf {I} _{p}-2i\theta \mathbf {I} _{p}|^{-1/2}\end{aligned}}} 
   
 
  
    
      
        
          I 
          
            p 
           
         
       
     
    {\displaystyle I_{p}} 
   
 
  
    
      
        p 
       
     
    {\displaystyle p} 
   
 
  
    
      
        
          
            
              
                = 
                ( 
                1 
                − 
                2 
                i 
                θ 
                
                  ) 
                  
                    − 
                    p 
                    
                      / 
                     
                    2 
                   
                 
               
             
           
         
       
     
    {\displaystyle {\begin{aligned}&=(1-2i\theta )^{-p/2}\end{aligned}}} 
   
 chi-square distribution  with 
  
    
      
        p 
       
     
    {\displaystyle p} 
   
 
  
    
      
        ◼ 
       
     
    {\displaystyle \;\;\;\blacksquare } 
   
 
  
 
Two-sample statistic [ edit ] If 
  
    
      
        
          
            
              x 
             
           
          
            1 
           
         
        , 
        … 
        , 
        
          
            
              x 
             
           
          
            
              n 
              
                x 
               
             
           
         
        ∼ 
        
          N 
          
            p 
           
         
        ( 
        
          μ 
         
        , 
        
          
            Σ 
           
         
        ) 
       
     
    {\displaystyle {\mathbf {x} }_{1},\dots ,{\mathbf {x} }_{n_{x}}\sim N_{p}({\boldsymbol {\mu }},{\mathbf {\Sigma } })} 
   
 
  
    
      
        
          
            
              y 
             
           
          
            1 
           
         
        , 
        … 
        , 
        
          
            
              y 
             
           
          
            
              n 
              
                y 
               
             
           
         
        ∼ 
        
          N 
          
            p 
           
         
        ( 
        
          μ 
         
        , 
        
          
            Σ 
           
         
        ) 
       
     
    {\displaystyle {\mathbf {y} }_{1},\dots ,{\mathbf {y} }_{n_{y}}\sim N_{p}({\boldsymbol {\mu }},{\mathbf {\Sigma } })} 
   
 independently  drawn from two independent  multivariate normal distributions  with the same mean and covariance, and we define
  
    
      
        
          
            
              x 
             
            ¯ 
           
         
        = 
        
          
            1 
            
              n 
              
                x 
               
             
           
         
        
          ∑ 
          
            i 
            = 
            1 
           
          
            
              n 
              
                x 
               
             
           
         
        
          
            x 
           
          
            i 
           
         
        
          
            
              y 
             
            ¯ 
           
         
        = 
        
          
            1 
            
              n 
              
                y 
               
             
           
         
        
          ∑ 
          
            i 
            = 
            1 
           
          
            
              n 
              
                y 
               
             
           
         
        
          
            y 
           
          
            i 
           
         
       
     
    {\displaystyle {\overline {\mathbf {x} }}={\frac {1}{n_{x}}}\sum _{i=1}^{n_{x}}\mathbf {x} _{i}\qquad {\overline {\mathbf {y} }}={\frac {1}{n_{y}}}\sum _{i=1}^{n_{y}}\mathbf {y} _{i}} 
   
 
as the sample means, and
  
    
      
        
          
            
              
                
                  
                    
                      
                        
                          Σ 
                         
                        ^ 
                       
                     
                   
                  
                    
                      x 
                     
                   
                 
               
              
                = 
                
                  
                    1 
                    
                      
                        n 
                        
                          x 
                         
                       
                      − 
                      1 
                     
                   
                 
                
                  ∑ 
                  
                    i 
                    = 
                    1 
                   
                  
                    
                      n 
                      
                        x 
                       
                     
                   
                 
                
                  ( 
                  
                    
                      
                        x 
                       
                      
                        i 
                       
                     
                    − 
                    
                      
                        
                          x 
                         
                        ¯ 
                       
                     
                   
                  ) 
                 
                
                  
                    ( 
                    
                      
                        
                          x 
                         
                        
                          i 
                         
                       
                      − 
                      
                        
                          
                            x 
                           
                          ¯ 
                         
                       
                     
                    ) 
                   
                  ′ 
                 
               
             
            
              
                
                  
                    
                      
                        
                          Σ 
                         
                        ^ 
                       
                     
                   
                  
                    
                      y 
                     
                   
                 
               
              
                = 
                
                  
                    1 
                    
                      
                        n 
                        
                          y 
                         
                       
                      − 
                      1 
                     
                   
                 
                
                  ∑ 
                  
                    i 
                    = 
                    1 
                   
                  
                    
                      n 
                      
                        y 
                       
                     
                   
                 
                
                  ( 
                  
                    
                      
                        y 
                       
                      
                        i 
                       
                     
                    − 
                    
                      
                        
                          y 
                         
                        ¯ 
                       
                     
                   
                  ) 
                 
                
                  
                    ( 
                    
                      
                        
                          y 
                         
                        
                          i 
                         
                       
                      − 
                      
                        
                          
                            y 
                           
                          ¯ 
                         
                       
                     
                    ) 
                   
                  ′ 
                 
               
             
           
         
       
     
    {\displaystyle {\begin{aligned}{\hat {\mathbf {\Sigma } }}_{\mathbf {x} }&={\frac {1}{n_{x}-1}}\sum _{i=1}^{n_{x}}\left(\mathbf {x} _{i}-{\overline {\mathbf {x} }}\right)\left(\mathbf {x} _{i}-{\overline {\mathbf {x} }}\right)'\\{\hat {\mathbf {\Sigma } }}_{\mathbf {y} }&={\frac {1}{n_{y}-1}}\sum _{i=1}^{n_{y}}\left(\mathbf {y} _{i}-{\overline {\mathbf {y} }}\right)\left(\mathbf {y} _{i}-{\overline {\mathbf {y} }}\right)'\end{aligned}}} 
   
 
as the respective sample covariance matrices.  Then
  
    
      
        
          
            
              
                Σ 
               
              ^ 
             
           
         
        = 
        
          
            
              ( 
              
                n 
                
                  x 
                 
               
              − 
              1 
              ) 
              
                
                  
                    
                      
                        Σ 
                       
                      ^ 
                     
                   
                 
                
                  
                    x 
                   
                 
               
              + 
              ( 
              
                n 
                
                  y 
                 
               
              − 
              1 
              ) 
              
                
                  
                    
                      
                        Σ 
                       
                      ^ 
                     
                   
                 
                
                  
                    y 
                   
                 
               
             
            
              
                n 
                
                  x 
                 
               
              + 
              
                n 
                
                  y 
                 
               
              − 
              2 
             
           
         
       
     
    {\displaystyle {\hat {\mathbf {\Sigma } }}={\frac {(n_{x}-1){\hat {\mathbf {\Sigma } }}_{\mathbf {x} }+(n_{y}-1){\hat {\mathbf {\Sigma } }}_{\mathbf {y} }}{n_{x}+n_{y}-2}}} 
   
 
is the unbiased pooled covariance matrix  estimate (an extension of pooled variance ).
Finally, the Hotelling's two-sample t -squared statistic  is
  
    
      
        
          t 
          
            2 
           
         
        = 
        
          
            
              
                n 
                
                  x 
                 
               
              
                n 
                
                  y 
                 
               
             
            
              
                n 
                
                  x 
                 
               
              + 
              
                n 
                
                  y 
                 
               
             
           
         
        ( 
        
          
            
              x 
             
            ¯ 
           
         
        − 
        
          
            
              y 
             
            ¯ 
           
         
        
          ) 
          ′ 
         
        
          
            
              
                
                  Σ 
                 
                ^ 
               
             
           
          
            − 
            1 
           
         
        ( 
        
          
            
              x 
             
            ¯ 
           
         
        − 
        
          
            
              y 
             
            ¯ 
           
         
        ) 
        ∼ 
        
          T 
          
            2 
           
         
        ( 
        p 
        , 
        
          n 
          
            x 
           
         
        + 
        
          n 
          
            y 
           
         
        − 
        2 
        ) 
       
     
    {\displaystyle t^{2}={\frac {n_{x}n_{y}}{n_{x}+n_{y}}}({\overline {\mathbf {x} }}-{\overline {\mathbf {y} }})'{\hat {\mathbf {\Sigma } }}^{-1}({\overline {\mathbf {x} }}-{\overline {\mathbf {y} }})\sim T^{2}(p,n_{x}+n_{y}-2)} 
   
 
It can be related to the F-distribution by[ 4] 
  
    
      
        
          
            
              
                n 
                
                  x 
                 
               
              + 
              
                n 
                
                  y 
                 
               
              − 
              p 
              − 
              1 
             
            
              ( 
              
                n 
                
                  x 
                 
               
              + 
              
                n 
                
                  y 
                 
               
              − 
              2 
              ) 
              p 
             
           
         
        
          t 
          
            2 
           
         
        ∼ 
        F 
        ( 
        p 
        , 
        
          n 
          
            x 
           
         
        + 
        
          n 
          
            y 
           
         
        − 
        1 
        − 
        p 
        ) 
        . 
       
     
    {\displaystyle {\frac {n_{x}+n_{y}-p-1}{(n_{x}+n_{y}-2)p}}t^{2}\sim F(p,n_{x}+n_{y}-1-p).} 
   
 
The non-null distribution of this statistic is the noncentral F-distribution  (the ratio of a non-central Chi-squared  random variable and an independent central Chi-squared  random variable) 
  
    
      
        
          
            
              
                n 
                
                  x 
                 
               
              + 
              
                n 
                
                  y 
                 
               
              − 
              p 
              − 
              1 
             
            
              ( 
              
                n 
                
                  x 
                 
               
              + 
              
                n 
                
                  y 
                 
               
              − 
              2 
              ) 
              p 
             
           
         
        
          t 
          
            2 
           
         
        ∼ 
        F 
        ( 
        p 
        , 
        
          n 
          
            x 
           
         
        + 
        
          n 
          
            y 
           
         
        − 
        1 
        − 
        p 
        ; 
        δ 
        ) 
        , 
       
     
    {\displaystyle {\frac {n_{x}+n_{y}-p-1}{(n_{x}+n_{y}-2)p}}t^{2}\sim F(p,n_{x}+n_{y}-1-p;\delta ),} 
   
 
  
    
      
        δ 
        = 
        
          
            
              
                n 
                
                  x 
                 
               
              
                n 
                
                  y 
                 
               
             
            
              
                n 
                
                  x 
                 
               
              + 
              
                n 
                
                  y 
                 
               
             
           
         
        
          
            d 
           
          ′ 
         
        
          
            Σ 
           
          
            − 
            1 
           
         
        
          d 
         
        , 
       
     
    {\displaystyle \delta ={\frac {n_{x}n_{y}}{n_{x}+n_{y}}}{\boldsymbol {d}}'\mathbf {\Sigma } ^{-1}{\boldsymbol {d}},} 
   
 
  
    
      
        
          d 
         
        = 
        
          
            
              x 
              ¯ 
             
           
          − 
          
            
              y 
              ¯ 
             
           
         
       
     
    {\displaystyle {\boldsymbol {d}}=\mathbf {{\overline {x}}-{\overline {y}}} } 
   
 
In the two-variable case, the formula simplifies nicely allowing appreciation of how the correlation, 
  
    
      
        ρ 
       
     
    {\displaystyle \rho } 
   
 
  
    
      
        
          t 
          
            2 
           
         
       
     
    {\displaystyle t^{2}} 
   
 
  
    
      
        
          d 
          
            1 
           
         
        = 
        
          
            
              x 
              ¯ 
             
           
          
            1 
           
         
        − 
        
          
            
              y 
              ¯ 
             
           
          
            1 
           
         
        , 
        
          d 
          
            2 
           
         
        = 
        
          
            
              x 
              ¯ 
             
           
          
            2 
           
         
        − 
        
          
            
              y 
              ¯ 
             
           
          
            2 
           
         
       
     
    {\displaystyle d_{1}={\overline {x}}_{1}-{\overline {y}}_{1},\qquad d_{2}={\overline {x}}_{2}-{\overline {y}}_{2}} 
   
 
  
    
      
        
          s 
          
            1 
           
         
        = 
        
          
            
              Σ 
              
                11 
               
             
           
         
        
          s 
          
            2 
           
         
        = 
        
          
            
              Σ 
              
                22 
               
             
           
         
        ρ 
        = 
        
          Σ 
          
            12 
           
         
        
          / 
         
        ( 
        
          s 
          
            1 
           
         
        
          s 
          
            2 
           
         
        ) 
        = 
        
          Σ 
          
            21 
           
         
        
          / 
         
        ( 
        
          s 
          
            1 
           
         
        
          s 
          
            2 
           
         
        ) 
       
     
    {\displaystyle s_{1}={\sqrt {\Sigma _{11}}}\qquad s_{2}={\sqrt {\Sigma _{22}}}\qquad \rho =\Sigma _{12}/(s_{1}s_{2})=\Sigma _{21}/(s_{1}s_{2})} 
   
 
  
    
      
        
          t 
          
            2 
           
         
        = 
        
          
            
              
                n 
                
                  x 
                 
               
              
                n 
                
                  y 
                 
               
             
            
              ( 
              
                n 
                
                  x 
                 
               
              + 
              
                n 
                
                  y 
                 
               
              ) 
              ( 
              1 
              − 
              
                ρ 
                
                  2 
                 
               
              ) 
             
           
         
        
          [ 
          
            
              
                ( 
                
                  
                    
                      d 
                      
                        1 
                       
                     
                    
                      s 
                      
                        1 
                       
                     
                   
                 
                ) 
               
              
                2 
               
             
            + 
            
              
                ( 
                
                  
                    
                      d 
                      
                        2 
                       
                     
                    
                      s 
                      
                        2 
                       
                     
                   
                 
                ) 
               
              
                2 
               
             
            − 
            2 
            ρ 
            
              ( 
              
                
                  
                    d 
                    
                      1 
                     
                   
                  
                    s 
                    
                      1 
                     
                   
                 
               
              ) 
             
            
              ( 
              
                
                  
                    d 
                    
                      2 
                     
                   
                  
                    s 
                    
                      2 
                     
                   
                 
               
              ) 
             
           
          ] 
         
       
     
    {\displaystyle t^{2}={\frac {n_{x}n_{y}}{(n_{x}+n_{y})(1-\rho ^{2})}}\left[\left({\frac {d_{1}}{s_{1}}}\right)^{2}+\left({\frac {d_{2}}{s_{2}}}\right)^{2}-2\rho \left({\frac {d_{1}}{s_{1}}}\right)\left({\frac {d_{2}}{s_{2}}}\right)\right]} 
   
 
  
    
      
        
          d 
         
        = 
        
          
            
              x 
             
            ¯ 
           
         
        − 
        
          
            
              y 
             
            ¯ 
           
         
       
     
    {\displaystyle \mathbf {d} ={\overline {\mathbf {x} }}-{\overline {\mathbf {y} }}} 
   
 
  
    
      
        
          t 
          
            2 
           
         
       
     
    {\displaystyle t^{2}} 
   
 
  
    
      
        ρ 
       
     
    {\displaystyle \rho } 
   
 
  
    
      
        
          t 
          
            2 
           
         
       
     
    {\displaystyle t^{2}} 
   
 
  
    
      
        ρ 
       
     
    {\displaystyle \rho } 
   
 
A univariate special case can be found in Welch's t-test .
More robust and powerful tests than Hotelling's two-sample test have been proposed in the literature, see for example the interpoint distance based tests which can be applied also when the number of variables is comparable with, or even larger than, the number of subjects.[ 9] [ 10] 
^ a b c   Hotelling, H.  (1931). "The generalization of Student's ratio" . Annals of Mathematical Statistics 2  (3): 360– 378. doi :10.1214/aoms/1177732979 ^ Johnson, R.A.; Wichern, D.W. (2002). Applied multivariate statistical analysis . Vol. 5. Prentice hall. ^ Eric W. Weisstein, MathWorld  
^ a b   Mardia, K. V.; Kent, J. T.; Bibby, J. M. (1979). Multivariate Analysis . Academic Press. ISBN  978-0-12-471250-8  ^ Fogelmark, Karl; Lomholt, Michael; Irbäck, Anders; Ambjörnsson, Tobias (3 May 2018). "Fitting a function to time-dependent ensemble averaged data" . Scientific Reports . 8  (1): 6984. doi :10.1038/s41598-018-24983-y . PMC  5934400 . Retrieved 19 August  2024 . ^ "6.5.4.3. Hotelling's T  squared" .^ End of chapter 4.2 of Johnson, R.A. & Wichern, D.W. (2002)  
^ Billingsley, P. (1995). "26. Characteristic Functions". Probability and measure  (3rd ed.). Wiley. ISBN  978-0-471-00710-4  ^ Marozzi, M. (2016). "Multivariate tests based on interpoint distances with application to magnetic resonance imaging". Statistical Methods in Medical Research . 25  (6): 2593– 2610. doi :10.1177/0962280214529104 . PMID  24740998 . ^ Marozzi, M. (2015). "Multivariate multidistance tests for high-dimensional low sample size case-control studies". Statistics in Medicine . 34  (9): 1511– 1526. doi :10.1002/sim.6418 . PMID  25630579 .   
Discrete  
with finite  with infinite  
Continuous  
supported on a  supported on a  supported  with support  
Mixed  
Multivariate  Directional Degenerate   singular Families