mean | R Documentation |
Compute the sample geometric or projected mean.
## S3 method for class 'SO3' mean(x, type = "projected", epsilon = 1e-05, maxIter = 2000, ...) ## S3 method for class 'Q4' mean(x, type = "projected", epsilon = 1e-05, maxIter = 2000, ...)
x |
n-by-p matrix where each row corresponds to a random rotation in matrix form (p=9) or quaternion (p=4) form. |
type |
string indicating "projected" or "geometric" type mean estimator. |
epsilon |
stopping rule for the geometric-mean. |
maxIter |
maximum number of iterations allowed for geometric-mean. |
... |
additional arguments. |
This function takes a sample of 3D rotations (in matrix or quaternion form)
and returns the projected arithmetic mean denoted S_P or geometric mean S_G according to the
type
option. For a sample of n rotations in matrix form
Ri in SO(3), i=1,2,…,n, the
mean-type estimator is defined as
argmin∑ d^2(Ri,S)
where d is the Riemannian or Euclidean distance. For more on the projected mean see moakher02 and for the geometric mean see manton04. For the projected mean from a quaternion point of view see tyler1981.
tyler1981, moakher02, manton04
Estimate of the projected or geometric mean of the sample in the same parametrization.
median.SO3
, bayes.mean
, weighted.mean.SO3
Rs <- ruars(20, rvmises, kappa = 0.01) # Projected mean mean(Rs) # Same as mean(Rs) project.SO3(colMeans(Rs)) # Geometric mean mean(Rs, type = "geometric") # Bias of the projected mean rot.dist(mean(Rs)) # Bias of the geometric mean rot.dist(mean(Rs, type = "geometric")) # Same thing with quaternion form Qs <- as.Q4(Rs) mean(Qs) mean(Qs, type = "geometric") rot.dist(mean(Qs)) rot.dist(mean(Qs, type = "geometric"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.