butools.trace.CdfFromWeightedTrace

butools.trace.CdfFromWeightedTrace()
Matlab: [x, y] = CdfFromWeightedTrace(trace, weights)
Mathematica: {x, y} = CdfFromWeightedTrace[trace, weights]
Python/Numpy: x, y = CdfFromWeightedTrace(trace, weights)

Returns the empirical distribution function of a trace consisting of weighted data.

Parameters:

trace : vector of doubles

The trace data

weights : vector of doubles

The weights corresponding to the trace data

Returns:

x : vector of doubles

The points where the empirical cdf is calculated

y : vector of doubles

The values of the empirical cdf at the given points

Examples

For Matlab:

>>> wtrace = [0.12, 1.23, 0.546, 0.6765, 1.34, 2.34];
>>> weights = [12., 1., 34., 23., 8., 2.];
>>> [x, y] = CdfFromWeightedTrace(wtrace, weights);
>>> plot(x, y)

For Mathematica:

>>> wtrace = {0.12, 1.23, 0.546, 0.6765, 1.34, 2.34};
>>> weights = {12., 1., 34., 23., 8., 2.};
>>> {x, y} = CdfFromWeightedTrace[wtrace, weights];
>>> ListLinePlot[{Transpose[{x, y}]}]

For Python/Numpy:

>>> wtrace = [0.12, 1.23, 0.546, 0.6765, 1.34, 2.34]
>>> weights = [12., 1., 34., 23., 8., 2.]
>>> x, y = CdfFromWeightedTrace(wtrace, weights)
>>> plt.plot(x, y)