diff scripts/deprecated/mahalanobis.m @ 22214:0ff3bd7d2750

mahalanobis: alternative for performance improvement (bug #45877)
author Lachlan Andrew <lachlanbis@gmail.com>
date Sat, 06 Aug 2016 23:47:20 +0100
parents 516bb87ea72e
children bac0d6f07a3e
line wrap: on
line diff
--- a/scripts/deprecated/mahalanobis.m	Sat Aug 06 05:18:34 2016 +0100
+++ b/scripts/deprecated/mahalanobis.m	Sat Aug 06 23:47:20 2016 +0100
@@ -76,13 +76,10 @@
 
   w = (x' * x + y' * y) / (xr + yr - 2);
 
-  winv = inv (w);
-
-  retval = (xm - ym) * winv * (xm - ym)';
+  retval = sumsq ((xm - ym) / chol (w));
 
 endfunction
 
-
 ## Test input validation
 %!error mahalanobis ()
 %!error mahalanobis (1, 2, 3)