Description Usage Arguments Value Examples
Given a set of starting coordinates, the function returns the Procrustean Transform of the initial points that minimizes the sum of squared positional difference from a set of reference coordinates. The (Euclidean) distances between a candidate configuration and the reference are evaluated by considering the couples of corresponding points.
The reference configuration must be centered at the origin.
1 | proc_crr(Z, Z0)
|
Z |
set of initial coordinates to be transformed |
Z0 |
set of reference coordinates centered at the origin |
Set of coordinates minimizing the distance between the initial configuration and the reference one
1 2 3 4 5 6 7 8 9 10 11 12 | # Create configuration and center it at the origin
pos_ref = matrix(runif(20), ncol=2)
pos_ref = t(t(pos_ref)-colMeans(pos_ref))
# Create a new configuration by adding a perturbation to the previous one
pos = pos_ref + matrix(rnorm(20, mean=1, sd=0.1), ncol=2)
# Compute the Procrustean Transform and inspect the results
proc_pos = proc_crr(pos, pos_ref)
plot(pos_ref, col="blue", pch=20, xlim=c(-1,3), ylim=c(-1,3))
points(pos, col="red", pch=20)
points(proc_pos, col="purple", pch=20)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.