Learn R Programming

rotations (version 1.5)

center: Center rotation data

Description

This function will take the sample Rs and return the sample Rs centered at S. That is, the ith observation of Rs denoted $Ri$ is returned as $S'Ri$. If S is the true center then the projected mean should be close to the 3-by-3 identity matrix.

Usage

center(x, S)
"center" (x, S)
"center" (x, S)

Arguments

x
$n-by-p$ matrix where each row corresponds to a random rotation in matrix ($p=9$) or quaternion ($p=4$) form.
S
the rotation or a matrix of $n-by-p$ rotations about which to center each row of x.

Value

The sample centered about S

Examples

Run this code
Rs <- ruars(5, rcayley)
cRs <- center(Rs, mean(Rs))
mean(cRs)                      #Close to identity matrix

all.equal(cRs, Rs - mean(Rs))  #TRUE, center and '-' have the same effect
                               #See ?"-.SO3" for more details

center(Rs,Rs)                  #n-Identity matrices: If the second argument is of the same dimension
                               #as Rs then each row is centered around the corresponding
                               #row in the first argument

Run the code above in your browser using DataLab