1% [x, y] = CdfFromWeightedTrace(trace, weights)
3% Returns the empirical distribution function of a trace
4% consisting of weighted data.
8% trace : vector of doubles
10% weights : vector of doubles
11% The weights corresponding to the trace data
15% x : vector of doubles
16% The points where the empirical cdf
is calculated
17% y : vector of doubles
18% The values of the empirical cdf at the given points
20function [x, y] = CdfFromWeightedTrace (trace, weights)
22 [x,ix] = sort (trace);
23 y = cumsum(weights(ix))/sum(weights);
24 x = reshape(x, 1, length(x));
25 y = reshape(y, 1, length(y));