LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
CdfFromWeightedTrace.m
1% [x, y] = CdfFromWeightedTrace(trace, weights)
2%
3% Returns the empirical distribution function of a trace
4% consisting of weighted data.
5%
6% Parameters
7% ----------
8% trace : vector of doubles
9% The trace data
10% weights : vector of doubles
11% The weights corresponding to the trace data
12%
13% Returns
14% -------
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
19
20function [x, y] = CdfFromWeightedTrace (trace, weights)
21
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));
26end