Skip to contents

Computes signed and scale-regime diagnostics for comparing estimated graph geodesic distances with reference geodesic distances. Distances are first optionally calibrated by the least-squares scale from isometry.scale().

Usage

isometry.geodesic.diagnostics(
  D.estimated,
  D.true,
  scale = TRUE,
  true.tol = sqrt(.Machine$double.eps),
  band.probs = c(1/3, 2/3)
)

Arguments

D.estimated

Estimated distance matrix or dist object.

D.true

Ground-truth distance matrix or dist object.

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.

band.probs

Numeric vector of two probabilities used to split reference distances into short, middle, and long distance bands.

Value

Named numeric vector with target-normalized graph-geodesic relative RMSE, signed residual bias, shortcut fraction, relative absolute residual quantiles, and median signed relative residuals in short/mid/long reference-distance bands. The relative-RMSE entry retains the historical name rel_geodesic_stress; it is not Kruskal's Stress-1.

Examples

D <- as.matrix(dist(1:4))
isometry.geodesic.diagnostics(1.1 * D, D)
#>  rel_geodesic_stress          signed_bias    shortcut_fraction 
#>         1.289963e-16        -1.221245e-16         1.000000e+00 
#> q50_rel_abs_residual q90_rel_abs_residual q95_rel_abs_residual 
#>         1.110223e-16         1.295260e-16         1.387779e-16 
#>      short_band_bias        mid_band_bias       long_band_bias 
#>        -1.110223e-16        -1.110223e-16        -1.480297e-16