/ani/mrses

To get this branch, use:
bzr branch http://suren.me/webbzr/ani/mrses

« back to all changes in this revision

Viewing changes to bmc.m

  • Committer: Suren A. Chilingaryan
  • Date: 2010-04-28 04:30:08 UTC
  • Revision ID: csa@dside.dyndns.org-20100428043008-vd9z0nso9axezvlp
Initial import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
function [rbhata,rmahal,rcorr]=bmc(x1,x2)
 
2
 
 
3
c1=cov(x1,1);
 
4
c2=cov(x2,1);
 
5
c=(c1+c2)./2;
 
6
 
 
7
m1=mean(x1);
 
8
m2=mean(x2);
 
9
 
 
10
rmahal=((m2-m1)/c)*(m2-m1)';
 
11
rcorr=2.*log(det(c)./sqrt(det(c1).*det(c2)));
 
12
rbhata=rmahal./8+rcorr./4;