function [E,es] = densityEst(points,new_x,new_y,BW) % function [E,es] = densityEst(points,new_x,new_y,BW) % Author - Deepti Pachauri % Department of Computer Sciences % University of Wisconsin - Madison % Construct construction map from scatter plot(minmax pairs) % This code make use of KDE implementation available at % http://www.ics.uci.edu/~ihler/code/. % Input- % points - original points (minmax pairs in 2D) % new_x - 2D grid to evaluate likelihood of a density estimate at given locations % new_y - 2D grid to evaluate likelihood of a density estimate at given locations % BW1 - bandwidth in dimension 1 % Output- % E - vectorized construction map (PDF) to feed in SVM % BW = 0.05; % new_x = linspace(0,5,50); p = kde(points,BW,ones(1,length(points)));% Gaussian kernel, 2D % BW = .05 in dim 1, .05 in dim 2. for i = 1: length(new_x) g = [new_x(i)*ones(size(new_y)); new_y]; es(i,:) = evaluate(p, g); end E = es(:);