diss: Dissimilarity between detrital age distributions

View source: R/mds.R

dissR Documentation

Dissimilarity between detrital age distributions

Description

Calculates the pairwise dissimilarity between detrital age distributions, using either the Wasserstein-2 or Kolmogorov-Smirnov distance.

Usage

diss(x, ...)

## Default S3 method:
diss(x, y, method = "KS", ...)

## S3 method for class 'detritals'
diss(x, method = "W2", ...)

Arguments

x

an object of class detrital OR a vector of numbers

...

extra arguments (not used)

y

a vector of numbers

method

either 'KS' (for Kolmogorov-Smirnov distance), or 'W2' (for Wasserstein-2 distance).

Details

The Kolmogorov-Smirnov statistic is the maximum vertical difference between two empirical cumulative distribution functions. The Wasserstein distance is a function of the area between them. Both dissimilarity measures are useful for multidimensional scaling.

Value

an object of class dist.

Author(s)

Written by Pieter Vermeesch, using modified code from Mathieu Vrac's CDFt package (KolmogorovSmirnov function), and Dominic Schuhmacher's transport package (transport1d function).

See Also

mds

Examples

d <- diss(examples$DZ,method='KS')
mds(d)

pvermees/IsoplotR documentation built on Nov. 18, 2024, 1:02 a.m.