mean {rotations} | R Documentation |
Mean rotation
Description
Compute the sample geometric or projected mean.
Usage
## 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, ...)
Arguments
x |
|
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. |
Details
This function takes a sample of 3D rotations (in matrix or quaternion form)
and returns the projected arithmetic mean denoted \widehat{\bm
S}_P
or geometric mean \widehat{\bm S}_G
according to the
type
option. For a sample of n
rotations in matrix form
\bm{R}_i\in SO(3), i=1,2,\dots,n
, the
mean-type estimator is defined as
\widehat{\bm{S}}=argmin_{\bm{S}\in
SO(3)}\sum_{i=1}^nd^2(\bm{R}_i,\bm{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
Value
Estimate of the projected or geometric mean of the sample in the same parametrization.
See Also
median.SO3
, bayes.mean
, weighted.mean.SO3
Examples
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"))