Skip to contents

Computes quantiles of pairwise relative absolute errors $$\left|\alpha\hat D_{ij}-D_{ij}\right|/D_{ij}.$$

Usage

isometry.rel.abs.error(
  D.estimated,
  D.true,
  probs = c(0.5, 0.95),
  scale = TRUE,
  true.tol = sqrt(.Machine$double.eps)
)

Arguments

D.estimated

Estimated distance matrix or dist object.

D.true

Ground-truth distance matrix or dist object.

probs

Numeric vector of probabilities passed to stats::quantile().

scale

Logical scalar. If TRUE, use isometry.scale() to optimally rescale estimated distances before computing the error.

true.tol

Non-negative tolerance. Pairs with true distance less than or equal to this value are excluded from relative metrics.

Value

Named numeric vector of relative absolute error quantiles.

Examples

D <- as.matrix(dist(1:4))
isometry.rel.abs.error(1.1 * D, D)
#>          50%          95% 
#> 1.110223e-16 1.387779e-16