rotdist.sum | R Documentation |
Compute the sum of the pth order distances between each row of x and S.
rotdist.sum(x, S = genR(0, space = class(x)), method = "extrinsic", p = 1) ## S3 method for class 'SO3' rotdist.sum(x, S = id.SO3, method = "extrinsic", p = 1) ## S3 method for class 'Q4' rotdist.sum(x, S = id.Q4, method = "extrinsic", p = 1)
x |
n-by-p matrix where each row corresponds to a random rotation in matrix (p=9) or quaternion (p=4) form. |
S |
the individual matrix of interest, usually an estimate of the mean. |
method |
type of distance used method in "extrinsic" or "intrinsic" |
p |
the order of the distances to compute. |
The sum of the pth order distance between each row of x and S.
rot.dist
Rs <- ruars(20, rvmises, kappa = 10) SE1 <- median(Rs) #Projected median SE2 <- mean(Rs) #Projected mean SR2 <- mean(Rs, type = "geometric") #Geometric mean #I will use "rotdist.sum" to verify these three estimators minimize the #loss function they are designed to minimize relative to the other esimators. #All of the following statements should evaluate to "TRUE" #The projected mean minimizes the sum of squared Euclidean distances rotdist.sum(Rs, S = SE2, p = 2) < rotdist.sum(Rs, S = SE1, p = 2) rotdist.sum(Rs, S = SE2, p = 2) < rotdist.sum(Rs, S = SR2, p = 2) #The projected median minimizes the sum of first order Euclidean distances rotdist.sum(Rs, S = SE1, p = 1) < rotdist.sum(Rs, S = SE2, p = 1) rotdist.sum(Rs, S = SE1, p = 1) < rotdist.sum(Rs, S = SR2, p = 1) #The geometric mean minimizes the sum of squared Riemannian distances rotdist.sum(Rs, S = SR2, p = 2, method = "intrinsic") < rotdist.sum(Rs, S = SE1, p = 2, method = "intrinsic") rotdist.sum(Rs, S = SR2, p = 2, method = "intrinsic") < rotdist.sum(Rs, S = SE2, p = 2, method = "intrinsic")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.