dist.BData: Distance method for BData objects

dist.BDataR Documentation

Distance method for BData objects

Description

Computes inter-distances between all objects of 'x'

Usage

## S3 method for class 'BData'
dist(x, ...)

## S3 method for class 'BDataLogDensities'
dist(x, ...)

## S3 method for class 'BDataSplines'
dist(x, ...)

Arguments

x

a data container of class 'BData' or derived

...

further parameters to 'stats::dist()', i.e. among other 'method' allows to use Manhattan or other Minkowski norms.

Value

a distance object, as 'stats::dist()'. The implementations rely on transformation to BDataSplines; the spline coefficients are first mapped to orthonormal coordinates via the Gram matrix of the basis, so that the default 'method = "euclidean"' yields the exact Bayes-space (clr-L2) distance also for non-orthonormal bases such as ZB-splines. Other 'method's (Manhattan, Minkowski, ...) operate on these orthonormal coordinates and depend on the chosen basis.

Functions

  • dist(BDataLogDensities): calculations for BDataLogDensities objects

  • dist(BDataSplines): calculations for BDataSplines objects

Examples

lbdl = BDataLogDensities(basis=B2N01Basis5, closed=TRUE,
  list(
    \(x)(dnorm(x,2,1,log=TRUE)),
    \(x)(dnorm(x,1,1,log=TRUE)),
    \(x)(dnorm(x,-1,1,log=TRUE)),
    \(x)(dnorm(x,-2,1,log=TRUE))
    ))
dist(lbdl)

DistributionalDDA documentation built on Oct. 20, 2026, 5:06 p.m.