Skip to content

distanceMoments

function distanceMoments(
hdIn,
ldIn,
opts?): DistanceMoments;

Defined in: passes/distances.ts:73

Delegates to the shared row loop in fused.ts with the rank accumulators switched off, so there is exactly one implementation of the sweep.

ParameterType
hdInPointsInput
ldInPointsInput
optsDistancePassOptions

DistanceMoments

import { distanceMoments, stress, pearsonR } from "@saehrimnir/sickle";
// The distance half of `analyze`, when you do not need the ranks — much
// cheaper, since nothing has to be sorted.
const m = distanceMoments(data, projection);
stress(m).value; // 0.0807
pearsonR(m).value; // 0.9967