Skip to content

despike builtin

despike(coords, values, *, radii=None, seed=0)

Breaks ties in values before a normal-score transform.

Tied samples, such as those at a detection limit, are ranked on the average over their neighborhood of each sample's rank, within each radius in turn, then on a seeded random draw. Several variables share one ordering: the averaged rank is the mean over the variables.

Parameters:

Name Type Description Default
coords (array_like, PointSet or BlockModel)

(n, 2) or (n, 3) sample coordinates, or a container.

required
values array_like, str or list of str

(n,) values, (n, k) values of k variables, or column names of coords.

required
radii sequence of float

Neighborhood radii, used smallest first. Defaults to 1, 2, 4 and 8 times the median distance to the nearest sample.

None
seed int

Seed of the last-resort random tie-break.

0

Returns:

Type Description
ndarray or Table

The values with each tie spread over tiny increasing offsets (at most 1e-4 of the gap to the next value) in rank order, so no ties remain and untied values keep their order. A Table when values are names.

used in