weighted.mean | R Documentation |
Compute the weighted geometric or projected mean of a sample of rotations.
## S3 method for class 'SO3'
weighted.mean(
x,
w = NULL,
type = "projected",
epsilon = 1e-05,
maxIter = 2000,
...
)
## S3 method for class 'Q4'
weighted.mean(
x,
w = NULL,
type = "projected",
epsilon = 1e-05,
maxIter = 2000,
...
)
x |
|
w |
vector of weights the same length as the number of rows in x giving
the weights to use for elements of x. Default is |
type |
string indicating "projected" or "geometric" type mean estimator. |
epsilon |
stopping rule for the geometric method. |
maxIter |
maximum number of iterations allowed before returning most recent estimate. |
... |
only used for consistency with mean.default. |
This function takes a sample of 3D rotations (in matrix or quaternion form)
and returns the weighted projected arithmetic mean \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
weighted mean is defined as
\widehat{\bm{S}}=argmin_{\bm{S}\in
SO(3)}\sum_{i=1}^nw_id^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.
moakher02
Weighted mean of the sample in the same parametrization.
median.SO3
, mean.SO3
, bayes.mean
Rs <- ruars(20, rvmises, kappa = 0.01)
# Find the equal-weight projected mean
mean(Rs)
# Use the rotation misorientation angle as weight
wt <- abs(1 / mis.angle(Rs))
weighted.mean(Rs, wt)
rot.dist(mean(Rs))
# Usually much smaller than unweighted mean
rot.dist(weighted.mean(Rs, wt))
# Can do the same thing with quaternions
Qs <- as.Q4(Rs)
mean(Qs)
wt <- abs(1 / mis.angle(Qs))
weighted.mean(Qs, wt)
rot.dist(mean(Qs))
rot.dist(weighted.mean(Qs, wt))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.