function [d1,d2] = pop_compare(x1,x2,W)

%POP_COMPARE computes local G*-stat for two populations.

%INPUTS: x1 = n-vector of pop 1 values
%        x2 = n-vector of pop 2 values
%         W = nxn weight matrix

p1 = x1/sum(x1) ; %normalize

p2 = x2/sum(x2) ; %normalize

d1 = W*p1;

d2 = W*p2;

hist_ts(d1);

title('Local G*-Distribution for POP 1'); 

pause;

hist_ts(d2);

title('Local G*-Distribution for POP 2'); 




