ccdf¶
champalimaud.ccdf
¶
The complementary cumulative distribution function (CCDF).
The CCDF of a sample is the fraction of the sample at or above a mark.
ccdf(sample)
¶
Compute the CCDF of a sample at each of its distinct values.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sample
|
array_like
|
The values; at least one. |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
Columns |
Examples:
Source code in champalimaud/ccdf.py
ccdf_at(sample, marks)
¶
Evaluate the CCDF of a sample at some marks.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sample
|
array_like
|
The values; at least one. |
required |
marks
|
array_like
|
Where to evaluate. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
For each mark, the fraction of |
Raises:
| Type | Description |
|---|---|
ValueError
|
For an empty sample. |
Examples:
Source code in champalimaud/ccdf.py
local_slopes(sample, marks)
¶
Compute the slope of the log-log CCDF between successive marks.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sample
|
array_like
|
The values; at least one. |
required |
marks
|
sequence of int
|
Increasing marks; a slope is taken between each pair of neighbors. |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
Columns |
Examples:
A sample whose CCDF halves at each doubling has slope -1:
>>> slopes = local_slopes([1, 1, 2, 4], [1, 2, 4])
>>> [round(float(s), 3) for s in slopes["slope"]]
[-1.0, -1.0]