Show
Ignore:
Timestamp:
02/21/10 20:58:32 (14 years ago)
Author:
smidl
Message:

Bhattacharyya pro Ivana

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • library/bdm/stat/exp_family.h

    r802 r809  
    199199        void dupdate ( mat &v, double nu = 1.0 ); 
    200200 
     201        //! evaluate bhattacharya distance 
     202        double bhattacharyya(const enorm<sq_T> &e2){ 
     203                bdm_assert(dim == e2.dimension(), "enorms of differnt dimensions"); 
     204                sq_T P=R; 
     205                P.add(e2._R()); 
     206                 
     207                double tmp = 0.125*P.invqform(mu - e2._mu()) + 0.5*(P.logdet() - 0.5*(R.logdet() + e2._R().logdet())); 
     208                return tmp; 
     209        } 
     210         
    201211        vec sample() const; 
    202212