median {rotations} | R Documentation |
Median rotation
Description
Compute the sample projected or geometric median.
Usage
## S3 method for class 'SO3'
median(
x,
na.rm = FALSE,
type = "projected",
epsilon = 1e-05,
maxIter = 2000,
...
)
## S3 method for class 'Q4'
median(
x,
na.rm = FALSE,
type = "projected",
epsilon = 1e-05,
maxIter = 2000,
...
)
Arguments
x |
|
na.rm |
a logical value indicating whether NA values should be stripped before the computation proceeds. |
type |
string indicating "projected" or "geometric" type mean estimator. |
epsilon |
stopping rule. |
maxIter |
maximum number of iterations allowed before returning most recent estimate. |
... |
additional arguments. |
Details
The median-type estimators are defined as
If the choice of
distance metric is Riemannian then the estimator is called the
geometric median, and if the distance metric in Euclidean then it is called
the projected median. The algorithm used in the geometric case is discussed
in hartley11 and the projected case is in stanfill2013.
hartley11 stanfill2013
Value
Estimate of the projected or geometric median in the same parametrization.
See Also
mean.SO3
, bayes.mean
,
weighted.mean.SO3
Examples
Rs <- ruars(20, rvmises, kappa = 0.01)
# Projected median
median(Rs)
# Geometric median
median(Rs, type = "geometric")
# Bias of the projected median
rot.dist(median(Rs))
# Bias of the geometric median
rot.dist(median(Rs, type = "geometric"))
Qs <- as.Q4(Rs)
# Projected median
median(Qs)
# Geometric median
median(Qs, type = "geometric")
# Bias of the projected median
rot.dist(median(Qs))
# Bias of the geometric median
rot.dist(median(Qs, type = "geometric"))