Skip to contents

Measures recovery of known coordinates, not preservation of graph distances. Existing layout stability and Figure 7 diagnostics are not changed.

Usage

score.coordinates(
  coords,
  reference,
  alignment = c("rigid", "none", "similarity"),
  allow_reflection = TRUE
)

Arguments

coords, reference

Numeric matrices of identical dimensions, with rows in the same observation order. Row names do not trigger reordering.

alignment

One of "rigid" (translation and orthogonal transformation), "none", or "similarity" (also fit a nonnegative uniform scale).

allow_reflection

Allow a reflection in the fitted orthogonal matrix.

Value

A list with rmse, relative_rmse, coords (aligned coordinates), rotation, translation, scale, alignment, and reference_radius. RMSE is the square root of the mean squared Euclidean vertex displacement, not the mean over individual coordinate entries. Relative RMSE divides it by the reference RMS radius about its centroid; it is NA for zero radius. The transformation is scale * coords %*% rotation + translation.

Details

A rigid fit preserves all distances. A similarity fit removes uniform scale as well. No vertex correspondence is estimated. A collapsed source is allowed for rigid alignment but has no identifiable similarity scale and is rejected for similarity alignment. Nonunique rotations in rank-deficient configurations can have the same minimum error.

Examples

x <- rbind(c(0, 0), c(1, 0), c(0, 1))
score.coordinates(x + 2, x)$rmse
#> [1] 1.812987e-16
score.coordinates(2 * x, x, alignment = "similarity")$scale
#> [1] 0.5