function [gmPDF, Z, gm, x_area, y_area] = buildGMM(plotArea, mu, sigma)
% BUILDGMM builds a gmm based on means and comvariances and gives the pdf
% back along with a matrix of points evaluated over the sim plot range

% mu = 10*rand(k,sim.d); % means
% sigma = 5 + ones(1,2,k); % covariances
gm = gmdistribution(mu, sigma);
gmPDF = @(x,y)pdf(gm,[x y]);
x_area = plotArea(1):0.1:plotArea(2); % use plot range
y_area = plotArea(3):0.1:plotArea(4);
Z = zeros(numel(y_area), numel(x_area));
for i = 1:numel(x_area)
    for j = 1:numel(y_area)
        
        Z(j,i) = gmPDF(x_area(i), y_area(j));
        
    end
end

% want to build in clever sampling based on the gm distribution so we dont
% have to sample as much

end