Learn R Programming

grip (version 0.3.0)

score.coordinates: Score coordinates against corresponding reference observations

Description

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
)

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.

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.

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

Run this code
x <- rbind(c(0, 0), c(1, 0), c(0, 1))
score.coordinates(x + 2, x)$rmse
score.coordinates(2 * x, x, alignment = "similarity")$scale

Run the code above in your browser using DataLab