search for: xx1t

Displaying 1 result from an estimated 1 matches for "xx1t".

Did you mean: xx1
2011 Nov 17
1
Vectorizing for weighted distance
...1.*X1,1); #square the elements of X1, weight it and repeat this vector N1 times XX2 = sum(w(:,ones(1,N2)).*X2.*X2,1); #square the elements of X2, weigh and repeat this vector N2 times X1X2 = (w(:,ones(1,N1)).*X1)'*X2; #get the weighted 'covariance' term XX1T = XX1'; #transpose z = XX1T(:,ones(1,N2)) + XX2(ones(1,N1),:) - 2*X1X2; #get the squared weighted distance which is basically doing: z=(X1-X2)' W (X1-X2) What would the best way (for SPEED) to do this? or is vectorizing as above the...